login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358701 a(n) is the least number > 1 that needs n toggles in the trailing bits of its binary representation to become a square. 1
4, 5, 7, 14, 79, 831, 6495, 247614, 7361278, 743300286, 121387475838 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
Michael S. Branicky, Go program.
Code Golf StackExchange, Toggle some bits and get a square, coding challenge started by user Arnauld, Aug 18 2018.
Delbert L. Johnson, C# program
EXAMPLE
a(0) = 4 = 100 in binary, 0 toggled bits needed;
a(1) = 5 = 101_2, 1 toggled bit -> 100_2 = 4;
a(2) = 7 = 111_2, 2 toggled bits -> 100_2 = 4;
a(3) = 14 = 1110_2, 3 toggled bits -> 1001_2 = 9;
a(4) = 79 = 1001111_2, 4 toggled bits -> 1000000_2 = 64;
a(5) = 831 = 1100111111_2, 5 toggled bits -> 1100010000_2 = 784 = 28^2.
PROG
See Code Golf link. - Arnauld Chevallier, Aug 18 2018
(Go) // see linked program
(C#) // see linked program
CROSSREFS
Sequence in context: A275273 A069575 A250182 * A072215 A106170 A353246
KEYWORD
nonn,base,hard,more
AUTHOR
Hugo Pfoertner, Dec 16 2022
EXTENSIONS
a(9) from Michael S. Branicky, Dec 19 2022
a(10) from Delbert L. Johnson, Apr 13 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 05:44 EDT 2024. Contains 372344 sequences. (Running on oeis4.)