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-10 of 16 results. Next

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

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

A029986 Numbers k such that k^2 is palindromic in base 4.

Original entry on oeis.org

0, 1, 5, 17, 21, 65, 71, 83, 257, 273, 281, 317, 1025, 1055, 4097, 4161, 4193, 4401, 5157, 5179, 5221, 16385, 16511, 16865, 17239, 65537, 65793, 65921, 66753, 68695, 69521, 69777, 80739, 82053, 82171, 82309, 82885, 83301, 262145
Offset: 1

Views

Author

Keywords

Crossrefs

Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), this sequence (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), A029805 (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Mathematica
    Select[Range[0,300000],IntegerDigits[#^2,4]==Reverse[ IntegerDigits[ #^2,4]]&] (* Harvey P. Dale, Dec 01 2015 *)
  • PARI
    isok(k) = my(d=digits(k^2,4)); d == Vecrev(d); \\ Michel Marcus, Jul 04 2021

A029990 Numbers k such that k^2 is palindromic in base 6.

Original entry on oeis.org

0, 1, 2, 7, 37, 43, 76, 91, 217, 259, 1064, 1297, 1333, 1519, 1555, 2704, 3367, 7777, 8029, 9079, 19747, 46657, 46873, 47989, 48205, 54439, 54655, 54695, 83979, 118027, 241304, 279937, 281449, 287749, 326599, 707707, 1679617
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007092.
Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), this sequence (b=6), A029992 (b=7), A029805 (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Mathematica
    palindromicQ[n_, b_:10] := TrueQ[IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]]]; Select[Range[1000], palindromicQ[#^2, 6] &] (* Alonso del Arte, Mar 05 2017 *)
  • PARI
    ispal(n,base)=my(d=digits(n,base)); d==Vecrev(d)
    is(n)==ispal(n^2,6) \\ Charles R Greathouse IV, Mar 09 2017

A029992 Numbers k such that k^2 is palindromic in base 7.

Original entry on oeis.org

0, 1, 2, 4, 8, 10, 11, 20, 32, 40, 50, 57, 64, 80, 160, 200, 344, 400, 500, 550, 557, 730, 1000, 1376, 1432, 1892, 2402, 2451, 2500, 2752, 2801, 3440, 3784, 3902, 5101, 5266, 6880, 8296, 9460, 9608, 9804, 16808, 17200, 19216, 19608, 22693
Offset: 1

Views

Author

Keywords

Examples

			8^2 = 64, which is 121 in base 7, and since that's palindromic, 8 is in the sequence.
9^2 = 81, which is 144 in base 7, but since that's not palindromic, 9 is not in the sequence.
		

Crossrefs

Cf. A002440 (squares written in base 7), A007093.
Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), this sequence (b=7), A029805 (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Magma
    [k:k in [0..23000]| Seqint(Intseq(k^2,7)) eq Seqint(Reverse(Intseq(k^2,7)))]; // Marius A. Burtea, Jan 22 2020
  • Mathematica
    Select[Range[0, 16806], IntegerDigits[#^2, 7] == Reverse[IntegerDigits[#^2, 7]] &] (* Alonso del Arte, Jan 21 2020 *)
  • Scala
    (0 to 16806).filter(n => Integer.toString(n * n, 7) == Integer.toString(n * n, 7).reverse) // Alonso del Arte, Jan 21 2020
    

A029733 Numbers k such that k^2 is palindromic in base 16.

Original entry on oeis.org

0, 1, 2, 3, 17, 34, 257, 273, 289, 305, 319, 514, 530, 546, 773, 1377, 4097, 4369, 4641, 8194, 8254, 8466, 8734, 9046, 51629, 65537, 65793, 66049, 66305, 69649, 69905, 70161, 70417, 73505, 73761, 74017, 74273, 76879, 92327, 131074
Offset: 1

Views

Author

Keywords

Crossrefs

Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), A029805 (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), this sequence (b=16), A118651 (b=17).

Programs

  • Mathematica
    n2palQ[n_]:=Module[{id=IntegerDigits[n^2,16]},id==Reverse[id]]; Select[ Range[ 0,150000],n2palQ] (* Harvey P. Dale, Mar 31 2018 *)
  • Python
    from itertools import count, islice
    def A029733_gen(): # generator of terms
        return filter(lambda k: (s:=hex(k**2)[2:])[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],count(0))
    A029733_list = list(islice(A029733_gen(),20)) # Chai Wah Wu, Jun 23 2022

A029805 Numbers k such that k^2 is palindromic in base 8.

Original entry on oeis.org

0, 1, 2, 3, 6, 9, 11, 27, 65, 73, 79, 81, 83, 195, 219, 237, 366, 513, 543, 585, 697, 1094, 1539, 1755, 1875, 2910, 4097, 4161, 4225, 4477, 4617, 4681, 4727, 4891, 5267, 8698, 8730, 11841, 12291, 12483, 12675, 13065, 13851, 14673, 15021
Offset: 1

Views

Author

Keywords

Comments

The only powers of 2 in this sequence are 1 and 2. - Alonso del Arte, Feb 25 2017

Examples

			3 is in the sequence because 3^2 = 9 = 11 in base 8, which is a palindrome.
4 is not in the sequence because 4^2 = 16 = 20 in base 8, which is not a palindrome.
		

Crossrefs

Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), this sequence (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Mathematica
    palQ[n_, b_:10] := Module[{idn = IntegerDigits[n, b]}, idn == Reverse[idn]]; Select[Range[0, 16000], palQ[#^2, 8] &] (* Harvey P. Dale, May 19 2012 *)
  • Python
    from itertools import count, islice
    def A029805_gen(): # generator of terms
        return filter(lambda k: (s:=oct(k**2)[2:])[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],count(0))
    A029805_list = list(islice(A029805_gen(),20)) # Chai Wah Wu, Jun 23 2022

A029994 Numbers k such that k^2 is palindromic in base 9.

Original entry on oeis.org

0, 1, 2, 10, 20, 82, 91, 100, 164, 730, 820, 1460, 6562, 6643, 6724, 7300, 7381, 7462, 13124, 13642, 13660, 14281, 54050, 59050, 59860, 65620, 66430, 118100, 123010, 126286, 161410, 161896, 487750, 531442, 532171
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007095.
Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), A029805 (b=8), this sequence (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Mathematica
    pb9Q[n_]:=Module[{idn=IntegerDigits[n^2,9]},idn==Reverse[idn]]; Select[ Range[0,600000],pb9Q] (* Harvey P. Dale, Sep 29 2013 *)

A029996 Numbers k such that k^2 is palindromic in base 11.

Original entry on oeis.org

0, 1, 2, 3, 6, 12, 24, 26, 72, 84, 122, 133, 144, 244, 255, 279, 382, 732, 1332, 1464, 1596, 2414, 2664, 2796, 3062, 4476, 7992, 14642, 14763, 14884, 15984, 16105, 16226, 17326, 29284, 29405, 30626, 33675, 34701, 63546, 87246, 87852, 88578
Offset: 1

Views

Author

Keywords

Crossrefs

Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), A029805 (b=8), A029994 (b=9), A002778 (b=10), this sequence (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

A118651 Numbers k such that k^2 is a palindrome when written in base 17.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 12, 18, 28, 36, 84, 108, 290, 307, 324, 341, 580, 597, 614, 1080, 1614, 1740, 1842, 2616, 3378, 3480, 3720, 4344, 4824, 4914, 5220, 5526, 6408, 9828, 10134, 10440, 14472, 17944, 19336, 24360, 27624, 29484, 31320, 33144, 33960
Offset: 1

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr), May 12 2006

Keywords

Examples

			E.g. 4^2 = 16_10 = G_16, 6^2 = 36_10 = 22_17, etc.
		

Crossrefs

Cf. A029984 for base 3, A029986 for base 4, A029988 for base 5, A029990 for base 6, A029992 for base 7, A029805 for base 8, A029994 for base 9, A002778 for base 10, A029996 for base 11, A029733 for base 16
Showing 1-10 of 16 results. Next