A003166 Numbers whose square in base 2 is a palindrome.
0, 1, 3, 4523, 11991, 18197, 141683, 1092489, 3168099, 6435309, 12489657, 17906499, 68301841, 295742437, 390117873, 542959199, 4770504939, 17360493407, 73798050723, 101657343993, 107137400475, 202491428745, 1615452642807, 4902182461643, 9274278357017, 12863364360297
Offset: 1
Examples
3^2 = 9 = 1001_2, a palindrome. 4523^2 = 20457529 = 1001110000010100000111001_2.
References
- G. J. Simmons, On palindromic squares of non-palindromic numbers, J. Rec. Math., 5 (No. 1, 1972), 11-19.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Don Knuth, Table of n, a(n) for n = 1..50 [This table extends earlier work of Gus Simmons, Jon Schoenfield, Don Knuth, and Michael Coriand]
- M. A. Alekseyev, Problem 11922. American Mathematical Monthly 123:7 (2016), 722.
- Patrick De Geest, Palindromic Squares in bases 2 to 17
- Carlos Rivera, Problem 89. Palindromic binary expression of primes squared, The Prime Puzzles & Problems Connection.
- G. J. Simmons, On palindromic squares of non-palindromic numbers, J. Rec. Math., 5 (No. 1, 1972), 11-19. [Annotated scanned copy]
Crossrefs
Programs
-
Mathematica
Do[c = RealDigits[n^2, 2][[1]]; If[c == Reverse[c], Print[n]], {n, 0, 10^9}]
-
PARI
is(n)=my(b=binary(n^2)); b==Vecrev(b) \\ Charles R Greathouse IV, Feb 07 2017
-
Python
from itertools import count, islice def A003166_gen(): # generator of terms return filter(lambda k: (s:=bin(k**2)[2:])[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],count(0)) A003166_list = list(islice(A003166_gen(),10)) # Chai Wah Wu, Jun 23 2022
Extensions
a(16) = 4770504939 found by Patrick De Geest, May 15 1999
a(17)-a(31) from Jon E. Schoenfield, May 08 2009
a(32) = 285000288617375,
a(33) = 301429589329949,
a(34) = 1178448744881657 from Don Knuth, Jan 28 2013 [who doublechecked the previous results and searched up to 2^104]
Comments