|
|
A002779
|
|
Palindromic squares.
(Formerly M3371 N1358)
|
|
41
|
|
|
0, 1, 4, 9, 121, 484, 676, 10201, 12321, 14641, 40804, 44944, 69696, 94249, 698896, 1002001, 1234321, 4008004, 5221225, 6948496, 100020001, 102030201, 104060401, 121242121, 123454321, 125686521, 400080004, 404090404, 522808225
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
These are numbers that are both squares (see A000290) and palindromes (see A002113).
|
|
REFERENCES
|
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
Martianus Frederic Ezerman, Bertrand Meyer and Patrick Solé, On Polynomial Pairs of Integers, Journal of Integer Sequences, Vol. 18 (2015), Article 15.3.5.
G. J. Simmons, Palindromic powers, J. Rec. Math., 3 (No. 2, 1970), 93-98. [Annotated scanned copy]
|
|
FORMULA
|
|
|
EXAMPLE
|
676 is included because it is both a perfect square and a palindrome.
|
|
MATHEMATICA
|
palindromicNumberQ = ((# // IntegerDigits // Reverse // FromDigits) == #) &; Select[Table[n^2, {n, 0, 9999}], palindromicNumberQ] (* Herman Beeksma, Jul 14 2005 *)
pb10Q[n_] := Module[{idn10 = IntegerDigits[n, 10]}, idn10 == Reverse[idn10]]; Select[Range[0, 19999]^2, pb10Q] (* Vincenzo Librandi, Jul 24 2014 *)
Select[Range[0, 22999]^2, PalindromeQ] (* Requires Mathematica version 10 or later. - Harvey P. Dale, May 01 2017 *)
|
|
PROG
|
(Haskell)
a002779 n = a002778_list !! (n-1)
a002779_list = filter ((== 1) . a136522) a000290_list
(Scala) def isPalindromic(n: BigInt): Boolean = n.toString == n.toString.reverse
val squares = ((1: BigInt) to (1000000: BigInt)).map(n => n * n)
(Magma) [k^2:k in [0..100000]| Intseq(k^2) eq Reverse(Intseq(k^2)) ]; // Marius A. Burtea, Oct 15 2019
(Python)
A002779_list = [int(s) for s in (str(m**2) for m in range(10**5)) if s == s[::-1]] # Chai Wah Wu, Aug 26 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,nice,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|