%I M3371 N1358 #103 Jul 27 2023 12:18:56
%S 0,1,4,9,121,484,676,10201,12321,14641,40804,44944,69696,94249,698896,
%T 1002001,1234321,4008004,5221225,6948496,100020001,102030201,
%U 104060401,121242121,123454321,125686521,400080004,404090404,522808225
%N Palindromic squares.
%C These are numbers that are both squares (see A000290) and palindromes (see A002113).
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Hans Havermann (via Feng Yuan), T. D. Noe (from P. De Geest) [to 485], <a href="/A002779/b002779.txt">Table of n, a(n) for n = 1..1940</a>
%H Martianus Frederic Ezerman, Bertrand Meyer and Patrick Solé, <a href="http://arxiv.org/abs/1210.7593">On Polynomial Pairs of Integers</a>, arXiv:1210.7593 [math.NT], 2012-2014. - From _N. J. A. Sloane_, Nov 08 2012
%H Martianus Frederic Ezerman, Bertrand Meyer and Patrick Solé, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Ezerman/eze3.html">On Polynomial Pairs of Integers</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.3.5.
%H Patrick De Geest, <a href="http://www.worldofnumbers.com/square.htm">Palindromic Squares</a>
%H W. R. Marshall, <a href="https://web.archive.org/web/20020614225321/http://www.geocities.com/williamrexmarshall/math/palsq.html">Palindromic Squares</a>
%H Phakhinkon Phunphayap, Prapanpong Pongsriiam, <a href="https://arxiv.org/abs/1803.09621">Reciprocal sum of palindromes</a>, arXiv:1803.00161 [math.CA], 2018.
%H G. J. Simmons, <a href="/A002778/a002778_2.pdf">Palindromic powers</a>, J. Rec. Math., 3 (No. 2, 1970), 93-98. [Annotated scanned copy]
%H G. J. Simmons, <a href="/A002778/a002778.pdf">On palindromic squares of non-palindromic numbers</a>, J. Rec. Math., 5 (No. 1, 1972), 11-19. [Annotated scanned copy]
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PalindromicNumber.html">Palindromic Number.</a>
%H Feng Yuan, <a href="http://www.fengyuan.com/palindrome.html">Palindromic Square Numbers</a>
%F From _Reinhard Zumkeller_, Oct 11 2011: (Start)
%F a(n) = A002778(n)^2.
%F A136522(A000290(a(n))) = 1.
%F A010052(a(n)) * A136522(a(n)) = 1. (End)
%e 676 is included because it is both a perfect square and a palindrome.
%t palindromicNumberQ = ((# // IntegerDigits // Reverse // FromDigits) == #) &; Select[Table[n^2, {n, 0, 9999}], palindromicNumberQ] (* _Herman Beeksma_, Jul 14 2005 *)
%t pb10Q[n_] := Module[{idn10 = IntegerDigits[n, 10]}, idn10 == Reverse[idn10]]; Select[Range[0, 19999]^2, pb10Q] (* _Vincenzo Librandi_, Jul 24 2014 *)
%t Select[Range[0, 22999]^2, PalindromeQ] (* Requires Mathematica version 10 or later. - _Harvey P. Dale_, May 01 2017 *)
%o (Haskell)
%o a002779 n = a002778_list !! (n-1)
%o a002779_list = filter ((== 1) . a136522) a000290_list
%o -- _Reinhard Zumkeller_, Oct 11 2011
%o (PARI) is(n)=my(d=digits(n)); d==Vecrev(d) && issquare(n) \\ _Charles R Greathouse IV_, Feb 06 2017
%o (Scala) def isPalindromic(n: BigInt): Boolean = n.toString == n.toString.reverse
%o val squares = ((1: BigInt) to (1000000: BigInt)).map(n => n * n)
%o squares.filter(isPalindromic(_)) // _Alonso del Arte_, Oct 07 2019
%o (Magma) [k^2:k in [0..100000]| Intseq(k^2) eq Reverse(Intseq(k^2)) ]; // _Marius A. Burtea_, Oct 15 2019
%o (Python)
%o 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
%Y Cf. A000290, A002113, A002778, A010052, A027829 (subsets), A028817, A029734.
%Y Cf. A029738, A029806, A029983, A029985, A029987, A029989, A029991, A029993.
%Y Cf. A029995, A029997, A029999, A030074, A030075, A057136, A136522.
%K nonn,base,nice,easy
%O 1,3
%A _N. J. A. Sloane_
|