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-9 of 9 results.

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

A263617 Number of numbers with at most n digits whose square is a palindrome.

Original entry on oeis.org

4, 7, 15, 20, 31, 37, 56, 70, 95, 113, 162, 193, 264, 310, 415, 486, 640, 741, 950, 1082, 1374, 1556, 1940, 2176, 2673, 2975, 3611, 3994, 4793, 5268, 6249, 6827, 8028, 8729
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2015

Keywords

Crossrefs

Partial sums of A263616.

Programs

  • Mathematica
    Table[Length[Select[Range[ 0, 10^n - 1], PalindromeQ[#^2] &]], {n, 6}] (* Robert Price, Apr 26 2019 *)

Extensions

a(9)-a(10) from Chai Wah Wu, Oct 25 2015
a(11)-a(12) from Michael S. Branicky, May 23 2021
a(13)-a(22) (using A002778) from Chai Wah Wu, Sep 16 2021
a(23)-a(34) from Max Alekseyev, Apr 08 2025

A263619 Number of palindromic squares with at most n digits.

Original entry on oeis.org

4, 4, 7, 7, 14, 15, 20, 20, 31, 31, 36, 37, 56, 56, 69, 70, 95, 95, 113, 113, 161, 162, 193, 193, 263, 264, 308, 310, 415, 415, 485, 486, 639, 640, 738, 741, 950, 950, 1082, 1082, 1373, 1374, 1555, 1556, 1940, 1940, 2174, 2176, 2672, 2673, 2974, 2975, 3611, 3611, 3994, 3994, 4792, 4793, 5267, 5268, 6249, 6249, 6827, 6827, 8026, 8028, 8729
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2015

Keywords

Crossrefs

Partial sums of A263618.

Programs

  • Mathematica
    Table[Length[Select[Range[0, Floor[Sqrt[10^n]]], PalindromeQ[#^2] &]], {n, 10}] (* Robert Price, Apr 26 2019 *)

Extensions

a(13)-a(19) from Chai Wah Wu, Oct 24 2015
a(20) from Robert Price, Apr 26 2019
a(21)-a(44) using A263618 from Chai Wah Wu, Jun 14 2024
a(45)-a(67) added by Max Alekseyev, Apr 08 2025

A263620 Number of nonzero palindromic squares with at most 2n digits.

Original entry on oeis.org

3, 6, 14, 19, 30, 36, 55, 69, 94, 112, 161, 192, 263, 309, 414, 485, 639, 740, 949, 1081, 1373, 1555
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[1, Floor[Sqrt[10^(2 n)]]], PalindromeQ[#^2] &]], {n, 6}] (* Robert Price, Apr 26 2019 *)
  • Python
    def ispal(n): s = str(n); return s == s[::-1]
    def a(n):
      c, k, kk = 0, 1, 1
      while kk < 10**(2*n): c, k, kk = c + (ispal(kk)), k+1, kk + 2*k + 1
      return c
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Mar 06 2021

Formula

Equals A263619(2n)-1.

Extensions

a(7)-a(10) from Chai Wah Wu, Oct 25 2015
More terms using A263618 from Chai Wah Wu, Jun 14 2024

A263616 Number of n-digit numbers whose square is a palindrome.

Original entry on oeis.org

4, 3, 8, 5, 11, 6, 19, 14, 25, 18, 49, 31, 71, 46, 105, 71, 154, 101, 209, 132, 292, 182, 384, 236, 497, 302, 636, 383, 799, 475, 981, 578, 1201, 701
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2015

Keywords

Comments

Number of terms in A002778 with exactly n digits.

Examples

			a(2) = 3 because there are three 2-digit numbers with palindromic squares: 11^2 = 121, 22^2 = 484, 26^2 = 676.
		

Crossrefs

Programs

  • Mathematica
    Join[{4},Table[Total[Table[If[PalindromeQ[n^2],1,0],{n,10^x,10^(x+1)-1}]],{x,9}]] (* Harvey P. Dale, Apr 09 2019 *)
  • Python
    from itertools import product
    def pal(n): s = str(n); return s == s[::-1]
    def a(n): return int(n==1) + sum(pal(i**2) for i in range(10**(n-1), 10**n))
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Apr 03 2021

Extensions

a(9)-a(10) from Chai Wah Wu, Oct 25 2015
a(11) from Michael S. Branicky, Apr 03 2021
a(12)-a(22) (using A002778) from Chai Wah Wu, Sep 16 2021
a(23)-a(34) from A002778 added by Max Alekseyev, Apr 08 2025

A307752 Number of n-digit palindromic pentagonal numbers.

Original entry on oeis.org

3, 1, 0, 2, 1, 1, 2, 2, 0, 4, 0, 0, 3, 1, 1, 1, 3, 2, 4, 1, 3, 1, 1, 0, 3, 3, 2, 2, 2, 0, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Robert Price, Apr 26 2019

Keywords

Comments

Number of n-digit terms in A002069.

Examples

			There are only two 4-digit pentagonal number that are palindromic, 1001 and 2882. Thus, a(4)=2.
		

Crossrefs

Programs

  • Mathematica
    A002069 = {0, 1, 5, 22, 1001, 2882, 15251, 720027, 7081807, 7451547, 26811862, 54177145, 1050660501, 1085885801, 1528888251, 2911771192, 2376574756732, 5792526252975, 5875432345785, 10810300301801, 264571020175462, 5292834004382925, 10808388588380801, 15017579397571051, 76318361016381367, 150621384483126051, 735960334433069537, 1003806742476083001, 1087959810189597801, 2716280733370826172};
    Table[Length[Select[A002069, IntegerLength[#] == n  || (n == 1 && # == 0) &]], {n, 18}] (* Robert Price, Apr 26 2019 *)
  • Python
    def afind(terms):
      m, n, c = 0, 1, 0
      while n <= terms:
        p = m*(3*m-1)//2
        s = str(p)
        if len(s) == n:
           if s == s[::-1]: c += 1
        else:
          print(c, end=", ")
          n, c = n+1, int(s == s[::-1])
        m += 1
    afind(14) # Michael S. Branicky, Mar 01 2021

Extensions

a(19)-a(22) from Michael S. Branicky, Mar 01 2021
a(23)-a(40) from Bert Dobbelaere, Apr 15 2025

A307765 Number of palindromic hexagonal numbers with exactly n digits.

Original entry on oeis.org

3, 1, 0, 2, 2, 2, 4, 0, 0, 3, 1, 0, 3, 1, 2, 1, 4, 1, 2, 1, 2, 0
Offset: 1

Views

Author

Robert Price, Apr 27 2019

Keywords

Comments

Number of terms in A054969 with exactly n digits.

Examples

			There are only two 4-digit hexagonal numbers that are palindromic, 3003 and 5995. Thus, a(4)=2.
		

Crossrefs

Programs

  • Mathematica
    A054969 = {0, 1, 6, 66, 3003, 5995, 15051, 66066, 617716, 828828, 1269621, 1680861, 5073705, 5676765, 1264114621, 5289009825, 6172882716, 13953435931, 1313207023131, 5250178710525, 6874200024786, 61728399382716, 602224464422206, 636188414881636, 1250444114440521, 16588189498188561, 58183932923938185, 66056806460865066, 67898244444289876, 514816979979618415, 3075488771778845703, 6364000440440004636, 15199896744769899151}; Table[Length[ Select[A054969, IntegerLength[#] == n || (n == 1 && # == 0) &]], {n, 19}]
  • Python
    def afind(terms):
      m, n, c = 0, 1, 0
      while n <= terms:
        p = m*(2*m-1)
        s = str(p)
        if len(s) == n:
           if s == s[::-1]: c += 1
        else:
          print(c, end=", ")
          n, c = n+1, int(s == s[::-1])
        m += 1
    afind(14) # Michael S. Branicky, Mar 01 2021

Extensions

a(20)-a(22) from Michael S. Branicky, Mar 01 2021

A307367 Number of palindromic triangular numbers with exactly n digits.

Original entry on oeis.org

4, 2, 3, 3, 2, 2, 6, 2, 1, 4, 7, 0, 4, 4, 12, 5, 6, 2, 3, 2, 6, 3, 6, 2, 2, 4, 3, 2, 5, 0, 3, 2, 1, 4, 3, 1, 10, 1, 4, 0, 3, 2, 2, 1, 1
Offset: 1

Views

Author

Robert Price, May 01 2019

Keywords

Comments

Number of terms in A003098 with exactly n digits.
Differs from A054263 only at a(1), assuming 0 has 1 digits. - R. J. Mathar, May 06 2019

Crossrefs

Programs

  • Mathematica
    A003098 = Select[PolygonalNumber[3, Range[0, 10^6]], PalindromeQ];
      (* Set Range to level of desired running time. \ *)
    Table[Length[ Select[A003098, IntegerLength[#] == n || (n == 1 && # == 0) &]], {n, 12}]
      (* Set Range to encompass length of last value in A003098. *)

A307753 Number of palindromic pentagonal numbers of length n whose index is also palindromic.

Original entry on oeis.org

3, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Robert Price, Apr 26 2019

Keywords

Comments

Is there a nonzero term beyond a(5)?

Examples

			There is only one palindromic pentagonal number of length 4 whose index is also palindromic, 44->2882. Thus, a(4)=1.
		

Crossrefs

Programs

  • Mathematica
    A002069 = {0, 1, 5, 22, 1001, 2882, 15251, 720027, 7081807, 7451547, 26811862, 54177145, 1050660501, 1085885801, 1528888251, 2911771192, 2376574756732, 5792526252975, 5875432345785, 10810300301801, 264571020175462, 5292834004382925, 10808388588380801, 15017579397571051, 76318361016381367, 150621384483126051, 735960334433069537, 1003806742476083001, 1087959810189597801, 2716280733370826172};
    A028386 = {0, 1, 2, 4, 26, 44, 101, 693, 2173, 2229, 4228, 6010, 26466, 26906, 31926, 44059, 1258723, 1965117, 1979130, 2684561, 13280839, 59401650, 84885761, 100058581, 225563533, 316882086, 700457153, 818049201, 851649306, 1345679688};
    Table[Length[Select[A028386[[Table[Select[Range[18], IntegerLength[A002069[[#]]] == n  || (n == 1 && A002069[[#]] == 0) &], {n, 18}][[n]]]], PalindromeQ[#] &]], {n, 18}]

Extensions

a(19)-a(35) from Chai Wah Wu, Sep 07 2019
Showing 1-9 of 9 results.