cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A002778 Numbers whose square is a palindrome.

Original entry on oeis.org

0, 1, 2, 3, 11, 22, 26, 101, 111, 121, 202, 212, 264, 307, 836, 1001, 1111, 2002, 2285, 2636, 10001, 10101, 10201, 11011, 11111, 11211, 20002, 20102, 22865, 24846, 30693, 100001, 101101, 110011, 111111, 200002, 798644, 1000001, 1001001
Offset: 1

Views

Author

Keywords

Comments

A002779(n) = a(n)^2; A136522(A000290(a(n))) = 1. - Reinhard Zumkeller, Oct 11 2011
See A016113 for the subset of numbers whose palindromic squares have an even number of digits. - M. F. Hasler, Jun 08 2014

Examples

			26^2 = 676, which is a palindrome, so 26 is in the sequence.
27^2 = 729, which is not a palindrome, so 27 is not in the sequence.
		

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).

Crossrefs

See A003166 for binary analog.
For analogs in bases 2,3,4,5,etc. see A003166 onwards, A029984 onwards, and A263607 onwards.

Programs

  • Haskell
    a002778 n = a002778_list !! (n-1)
    a002778_list = filter ((== 1) . a136522 . (^ 2)) [0..]
    -- Reinhard Zumkeller, Oct 11 2011
    
  • Magma
    [n: n in [0..2*10^6] | Intseq(n^2) eq Reverse(Intseq(n^2))]; // Vincenzo Librandi, Apr 07 2015
    
  • Mathematica
    palsquareQ[n_] := (n2 = IntegerDigits[n^2]; n2 == Reverse[n2]); A002778 = {}; Do[ If[palsquareQ[n], Print[n]; AppendTo[A002778, n]], {n, 0, 2 * 10^6}]; A002778 (* Jean-François Alcover, Dec 01 2011 *)
    Sqrt[#]&/@Select[Range[0, 12 * 10^5]^2, # == IntegerReverse[#] &] (* The program uses the IntegerReverse function from Mathematica version 10. - Harvey P. Dale, Mar 04 2016 *)
    Select[Range[0, 1001001], PalindromeQ[#^2] &] (* Michael De Vlieger, Dec 06 2017 *)
  • PARI
    is_A002778(n)=is_A002113(n^2) \\ M. F. Hasler, Jun 08 2014
    
  • Python
    from itertools import count, islice
    def A002778_gen(): # generator of terms
        return filter(lambda k: (s:=str(k**2))[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],count(0))
    A002778_list = list(islice(A002778_gen(),20)) # Chai Wah Wu, Jun 23 2022

Extensions

More terms from Patrick De Geest

A029984 Numbers k such that k^2 is palindromic in base 3.

Original entry on oeis.org

0, 1, 2, 4, 10, 11, 20, 22, 28, 34, 56, 82, 89, 113, 154, 164, 244, 262, 488, 524, 730, 755, 802, 862, 1021, 1342, 1358, 1460, 2188, 2242, 2684, 2716, 3046, 4276, 4376, 4484, 6562, 6641, 6778, 8030, 8215, 8350, 8887, 12482, 13124, 14810, 19684
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pal3Q[n_]:=Module[{idn3=IntegerDigits[n^2,3]},idn3==Reverse[idn3]]; Select[Range[0,20000],pal3Q]  (* Harvey P. Dale, May 22 2012 *)

A029985 Squares which are palindromes in base 3.

Original entry on oeis.org

0, 1, 4, 16, 100, 121, 400, 484, 784, 1156, 3136, 6724, 7921, 12769, 23716, 26896, 59536, 68644, 238144, 274576, 532900, 570025, 643204, 743044, 1042441, 1800964, 1844164, 2131600, 4787344, 5026564, 7203856, 7376656, 9278116
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    b3pQ[n_]:=Module[{idn3=IntegerDigits[n,3]},idn3==Reverse[idn3]]; Select[ Range[0,3200]^2,b3pQ] (* Harvey P. Dale, Aug 07 2011 *)
Showing 1-3 of 3 results.