OFFSET
1,1
REFERENCES
Charles Ashbacher, More on palindromic squares, J. Rec. Math. 22, no. 2 (1990), 133-135. [A scan of the first page of this article is included with the last page of the Keith (1990) scan]
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..14
K. S. Brown, On General Palindromic Numbers
Patrick De Geest, Palindromic Squares
Patrick De Geest, Subsets of Palindromic Squares
Michael Keith, Classification and enumeration of palindromic squares, J. Rec. Math., 22 (No. 2, 1990), 124-132. [Annotated scanned copy]
FORMULA
a(n) = A016113(n)^2. - M. F. Hasler, Jun 08 2014
EXAMPLE
836^2 = 698896, which is palindromic, so 698896 is in the sequence.
1001^2 = 1002001, which is palindromic, but it has an odd number of digits, so it's not in the sequence.
MATHEMATICA
Select[Range[1000000]^2, PalindromeQ[#] && OddQ[Floor[Log[10, #]]] &] (* Alonso del Arte, Oct 11 2019 *)
PROG
(PARI) is_A027829(n)={issquare(n)&&Vecrev(n=digits(n))==n&&!bittest(#n, 0)} \\ This is faster than first checking for even length if applied to numbers known to have an even number of digits, as should be the case for a systematic search. For this, one should only consider squares, i.e., rather use is_A016113. - M. F. Hasler, Jun 08 2014
(Scala) def isPalindromic(n: BigInt): Boolean = n.toString == n.toString.reverse
val squares = ((1: BigInt) to (1000000: BigInt)).map(n => n * n)
squares.filter(n => isPalindromic(n) && n.toString.length % 2 == 0) // Alonso del Arte, Oct 07 2019
(Python)
from math import isqrt
from itertools import count, islice
def A027829_gen(): # generator of terms
return filter(lambda n: (s:=str(n))[:(t:=(len(s)+1)//2)]==s[:-t-1:-1], map(lambda n: n**2, (d for l in count(2, 2) for d in range(isqrt(10**(l-1))+1, isqrt(10**l)+1))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Keith Devlin, via Boon Leong (boon_leong(AT)hotmail.com)
EXTENSIONS
Two new terms were recently found by Bennett from UK (communication from Patrick De Geest, Dec. 1999 or before)
Edited by M. F. Hasler, Jun 08 2014
STATUS
approved