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 41 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

A033934 a(n) = (10^n + 1)^2.

Original entry on oeis.org

4, 121, 10201, 1002001, 100020001, 10000200001, 1000002000001, 100000020000001, 10000000200000001, 1000000002000000001, 100000000020000000001, 10000000000200000000001, 1000000000002000000000001, 100000000000020000000000001, 10000000000000200000000000001
Offset: 0

Views

Author

Keywords

Comments

The members of this sequence are both perfect squares and palindromes. Therefore A002779 is an infinite sequence. - Ant King, Jun 26 2011

Crossrefs

Cf. A002779 (palindromic squares), A000290 (squares), A002113 (palindromes).

Programs

  • Mathematica
    (10^Range[0,20]+1)^2 (* or *) LinearRecurrence[{111,-1110,1000},{4,121,10201},20] (* Harvey P. Dale, Feb 16 2016 *)
  • PARI
    my(x='x+O('x^15)); Vec((1210*x^2-323*x+4)/(-1000*x^3+1110*x^2-111*x+1)) \\ Elmo R. Oliveira, Jul 04 2025

Formula

a(n) = A062397(n)^2 = A066138(n) + A011557(n).
From Elmo R. Oliveira, Jul 04 2025: (Start)
G.f.: (4 - 323*x + 1210*x^2)/((1-x)*(1-10*x)*(1-100*x)).
E.g.f.: exp(x)*(1 + 2*exp(9*x) + exp(99*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3). (End)

Extensions

Better description from Henry Bottomley, Dec 07 2001
More terms from Harvey P. Dale, Feb 16 2016

A034822 Numbers k such that there are no palindromic squares of length k.

Original entry on oeis.org

2, 4, 8, 10, 14, 18, 20, 24, 30, 38, 40
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

All terms are even since (10^k+1)^2 is a palindrome of length 2*k+1. a(12) >= 46 if it exists (see A263618). - Chai Wah Wu, Jun 14 2024

Crossrefs

Programs

  • Mathematica
    A034822[n_] := Select[Range[Ceiling[Sqrt[10^(n - 1)]], Floor[Sqrt[10^n]]], #^2 == IntegerReverse[#^2] &];
    Select[Range[12], Length[A034822[#]] == 0 &] (* Robert Price, Apr 23 2019 *)
  • Python
    from sympy import integer_nthroot as iroot
    def ispal(n): s = str(n); return s == s[::-1]
    def ok(n):
      for r in range(iroot(10**(n-1), 2)[0] + 1, iroot(10**n, 2)[0]):
        if ispal(r*r): return False
      return True
    print([m for m in range(1, 16) if ok(m)]) # Michael S. Branicky, Feb 04 2021

Extensions

Two more terms from Patrick De Geest, Apr 01 2002

A035090 Non-palindromic squares which when written backwards remain square (and still have the same number of digits).

Original entry on oeis.org

144, 169, 441, 961, 1089, 9801, 10404, 10609, 12544, 12769, 14884, 40401, 44521, 48841, 90601, 96721, 1004004, 1006009, 1022121, 1024144, 1026169, 1042441, 1044484, 1062961, 1212201, 1214404, 1216609, 1236544, 1238769, 1256641
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Squares with trailing zeros not included.
Sequence is infinite, since it includes, e.g., 10^(2k) + 4*10^k + 4 for all k. - Robert Israel, Sep 20 2015

Crossrefs

Reversing a polytopal number gives a polytopal number:
cube to cube: A035123, A035124, A035125, A002781;
square to square: A161902, A035090, A033294, A106323, A106324, A002779;
square to triangular: A181412, A066702;
tetrahedral to tetrahedral: A006030;
triangular to square: A066703, A179889;
triangular to triangular: A066528, A069673, A003098, A066569.
Cf. A319388.

Programs

  • Maple
    rev:= proc(n) local L,i;
    L:= convert(n,base,10);
    add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= proc(n) local t;
      if n mod 10 = 0 then return false fi;
      t:= rev(n);
    t <> n and issqr(t)
    end proc:
    select(filter, [seq(n^2, n=1..10^5)]); # Robert Israel, Sep 20 2015
  • Mathematica
    Select[Range[1200]^2,!PalindromeQ[#]&&IntegerLength[#]==IntegerLength[ IntegerReverse[ #]] && IntegerQ[Sqrt[IntegerReverse[#]]]&] (* Harvey P. Dale, Jul 19 2023 *)

Formula

a(n) = A035123(n)^2. - R. J. Mathar, Jan 25 2017

A029734 Palindromic squares in base 16.

Original entry on oeis.org

0, 1, 4, 9, 289, 1156, 66049, 74529, 83521, 93025, 101761, 264196, 280900, 298116, 597529, 1896129, 16785409, 19088161, 21538881, 67141636, 68128516, 71673156, 76282756, 81830116, 2665553641, 4295098369, 4328718849
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pb16Q[n_]:=Module[{idn16=IntegerDigits[n,16]}, idn16==Reverse[idn16]]; Select[Range[0, 200000]^2, pb16Q] (* Vincenzo Librandi, Jul 24 2014 *)

A029738 Palindromic squares in base 12.

Original entry on oeis.org

0, 1, 4, 9, 169, 676, 21025, 24649, 28561, 32041, 32761, 84100, 85264, 91204, 373321, 2989441, 3045025, 3179089, 3553225, 4165681, 11957764, 13060996, 14409616, 430023169, 436016161, 442050625, 448126561, 505215529
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pb12Q[n_]:=Module[{idn12=IntegerDigits[n, 12]}, idn12==Reverse[idn12]]; Select[Range[0, 20000]^2, pb12Q] (* Vincenzo Librandi, Jul 24 2014 *)

A029806 n in base 8 is a palindromic square.

Original entry on oeis.org

0, 1, 4, 9, 36, 81, 121, 729, 4225, 5329, 6241, 6561, 6889, 38025, 47961, 56169, 133956, 263169, 294849, 342225, 485809, 1196836, 2368521, 3080025, 3515625, 8468100, 16785409, 17313921, 17850625, 20043529, 21316689, 21911761
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pb8Q[n_]:=Module[{idn8=IntegerDigits[n, 8]}, idn8==Reverse[idn8]]; Select[Range[0, 20000]^2, pb8Q] (* Vincenzo Librandi, Jul 24 2014 *)

A029991 Squares which are palindromes in base 6.

Original entry on oeis.org

0, 1, 4, 49, 1369, 1849, 5776, 8281, 47089, 67081, 1132096, 1682209, 1776889, 2307361, 2418025, 7311616, 11336689, 60481729, 64464841, 82428241, 389944009, 2176875649, 2197078129, 2302944121, 2323722025, 2963604721
Offset: 1

Views

Author

Keywords

Crossrefs

Squares which are palindromes in base b: A029983 (b=2), A029985 (b=3), A029987 (b=4), A029989 (b=5), this sequence (b=6), A029993 (b=7), A029806 (b=8), A029995 (b=9), A002779 (b=10), A029997 (b=11), A029738 (b=12), A029999 (b=13), A030074 (b=14), A030075 (b=15), A029734 (b=16).
Cf. A029990.

Formula

a(n) = A029990(n)^2. - Seiichi Manyama, Oct 16 2021

A029993 Squares which are palindromes in base 7.

Original entry on oeis.org

0, 1, 4, 16, 64, 100, 121, 400, 1024, 1600, 2500, 3249, 4096, 6400, 25600, 40000, 118336, 160000, 250000, 302500, 310249, 532900, 1000000, 1893376, 2050624, 3579664, 5769604, 6007401, 6250000, 7573504, 7845601, 11833600
Offset: 1

Views

Author

Keywords

Crossrefs

Squares which are palindromes in base b: A029983 (b=2), A029985 (b=3), A029987 (b=4), A029989 (b=5), A029991 (b=6), this sequence (b=7), A029806 (b=8), A029995 (b=9), A002779 (b=10), A029997 (b=11), A029738 (b=12), A029999 (b=13), A030074 (b=14), A030075 (b=15), A029734 (b=16).
Cf. A029992.

Programs

  • Mathematica
    pal7Q[n_]:=Module[{idn7=IntegerDigits[n,7]},idn7==Reverse[idn7]]; Select[Range[0,3500]^2,pal7Q] (* Harvey P. Dale, Dec 15 2011 *)

Formula

a(n) = A029992(n)^2. - Seiichi Manyama, Oct 16 2021

A029995 Squares which are palindromes in base 9.

Original entry on oeis.org

0, 1, 4, 100, 400, 6724, 8281, 10000, 26896, 532900, 672400, 2131600, 43059844, 44129449, 45212176, 53290000, 54479161, 55681444, 172239376, 186104164, 186595600, 203946961, 2921402500, 3486902500, 3583219600
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    pal9Q[n_]:=Module[{idn9=IntegerDigits[n,9]},idn9==Reverse[idn9]]; Select[ Range[0,60000]^2,pal9Q] (* Harvey P. Dale, Nov 12 2011 *)
Showing 1-10 of 41 results. Next