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 55 results. Next

A120764 Number of terms of A007632 less than or equal to 10^n.

Original entry on oeis.org

2, 6, 8, 11, 13, 19, 20, 27, 28, 31, 33, 37, 39, 49, 50, 52, 54, 61, 63, 65, 68, 70, 70, 74, 74, 80, 81, 87, 88, 93, 94, 96, 96, 99, 102, 108, 112, 117, 118, 121, 122
Offset: 0

Views

Author

Charlton Harrison (charlton(AT)bach.dynet.com) and Robert G. Wilson v, Jul 03 2006

Keywords

Comments

A007632: Palindromic in bases 2 and 10.

Examples

			a(4)=13 because {0, 1, 3, 5, 7, 9, 33, 99, 313, 585, 717, 7447, 9009} are all the terms of A007632 less than 10^4.
		

Crossrefs

Cf. A007632.

Programs

  • Mathematica
    lst = { (* the list of terms from A007632 *) }; Table[ Length@ Select[lst, # <= 10^n &], {n, 0, 33}]

Extensions

a(34) - a(40) from Robert G. Wilson v, Jun 19 2014

A029965 Palindromic in bases 9 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 191, 282, 373, 464, 555, 646, 656, 6886, 25752, 27472, 42324, 50605, 626626, 1540451, 1713171, 1721271, 1828281, 1877781, 1885881, 2401042, 2434342, 2442442, 2450542, 3106013, 3114113, 3122213, 3163613
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 9], AppendTo[l, a]], {n, 10000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    pQ[n_,k_]:=Reverse[x=IntegerDigits[n,k]]==x; t={}; Do[If[pQ[n,10] && pQ[n,9],AppendTo[t,n]],{n,3.2*10^6}]; t (* Jayanta Basu, May 25 2013 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 9] &] (* Robert Price, Nov 09 2019 *)

A029966 Palindromic in bases 10 and 11.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 232, 343, 454, 565, 676, 787, 898, 909, 26962, 38183, 40504, 49294, 52825, 63936, 75157, 2956592, 2968692, 3262623, 3274723, 3286823, 3298923, 3360633, 3372733, 4348434, 4410144, 4422244, 4581854
Offset: 1

Views

Author

Keywords

Comments

The first 79 terms all have an odd number of decimal digits. Is there a term with an even number of decimal digits? - Robert Israel, Nov 23 2014

Crossrefs

Programs

  • Magma
    [n: n in [0..5000000] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 11) eq Reverse(Intseq(n, 11))]; // Vincenzo Librandi, Nov 23 2014
  • Maple
    N:= 11: # to get all terms with up to N decimal digits
    qpali:= proc(k, b) local L; L:= convert(k, base, b); if L = ListTools:-Reverse(L) then k else NULL fi end proc:
    digrev:= proc(k,b) local L,n; L:= convert(k,base,b); n:= nops(L); add(L[i]*b^(n-i),i=1..n); end proc:
    Res:= $0..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, seq(qpali(n*10^m + digrev(n,10),11), n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Res:= Res, seq(seq(qpali(n*10^(m+1)+y*10^m+digrev(n,10),11), y=0..9), n=10^(m-1)..10^m-1);
      fi
    od:
    Res;  # Robert Israel, Nov 23 2014
  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 12], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    b1=10; b2=11; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Nov 23 2014 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 11] &] (* Robert Price, Nov 09 2019 *)

A007633 Palindromic in bases 3 and 10.

Original entry on oeis.org

0, 1, 2, 4, 8, 121, 151, 212, 242, 484, 656, 757, 29092, 48884, 74647, 75457, 76267, 92929, 93739, 848848, 1521251, 2985892, 4022204, 4219124, 4251524, 4287824, 5737375, 7875787, 7949497, 27711772, 83155138, 112969211, 123464321
Offset: 1

Views

Author

Keywords

References

  • J. Meeus, Multibasic palindromes, J. Rec. Math., 18 (No. 3, 1985-1986), 168-173.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    ND:= 12;  # to get all terms with <= ND decimal digits
    rev10:= proc(n) option remember;
      rev10(floor(n/10)) + (n mod 10)*10^ilog10(n)
    end;
    for i from 0 to 9 do rev10(i):= i od:
    rev3:= proc(n) option remember;
      rev3(floor(n/3)) + (n mod 3)*3^ilog[3](n)
    end;
    for i from 0 to 2 do rev3(i):= i od:
    pali3:= n -> rev3(n) = n;
    count:= 1:
    A[1]:= 0:
    for d from 1 to ND do
      d1:= ceil(d/2);
      for x from 10^(d1-1) to 10^d1 - 1 do
        if d::even then y:= x*10^d1+rev10(x)
        else y:= x*10^(d1-1)+rev10(floor(x/10));
        fi;
        if pali3(y) then
           count:= count+1;
           A[count]:= y;
        fi
      od:
    od:
    seq(A[i],i=1..count); # Robert Israel, Apr 20 2014
  • Mathematica
    Do[ a = IntegerDigits[n]; b = IntegerDigits[n, 3]; If[a == Reverse[a] && b == Reverse[b], Print[n] ], {n, 0, 10^9} ]
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 4], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    pal3Q[n_]:=Module[{idn3=IntegerDigits[n,3]},idn3==Reverse[idn3]]; Select[ Range[ 0,1235*10^5],PalindromeQ[#]&&pal3Q[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 04 2019 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 3] &] (* Robert Price, Nov 09 2019 *)
  • Python
    from itertools import chain
    from gmpy2 import digits
    A007633_list = sorted([n for n in chain((int(str(x)+str(x)[::-1]) for x in range(1,10**6)),(int(str(x)+str(x)[-2::-1]) for x in range(10**6))) if digits(n,3) == digits(n,3)[::-1]]) # Chai Wah Wu, Nov 23 2014

A029961 Palindromic in bases 4 and 10.

Original entry on oeis.org

0, 1, 2, 3, 5, 55, 373, 393, 666, 787, 939, 7997, 53235, 55255, 55655, 57675, 506605, 1801081, 2215122, 3826283, 3866683, 5051505, 5226225, 5259525, 5297925, 5614165, 5679765, 53822835, 623010326, 954656459, 51717171715
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 4], AppendTo[l, a]], {n, 1000000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 4] &] (* Robert Price, Nov 09 2019 *)

A029964 Palindromic in bases 7 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 121, 171, 242, 292, 16561, 65656, 2137312, 4602064, 6597956, 6958596, 9470749, 61255216, 230474032, 466828664, 485494584, 638828836, 657494756, 858474858, 25699499652, 40130703104, 45862226854
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 7], AppendTo[l, a]], {n, 2000000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 7] &] (* Robert Price, Nov 09 2019 *)

A029970 Numbers that are palindromic in bases 10 and 15.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 828, 858, 888, 919, 949, 979, 1551, 2772, 23632, 25552, 60106, 67576, 465564, 477774, 489984, 515515, 527725, 17577571, 26144162, 28300382, 39399393, 47999974, 69455496, 2118008112, 8050880508
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 15) eq Reverse(Intseq(n, 15))]; // Vincenzo Librandi, Nov 23 2014
  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 15], AppendTo[l, a]], {n, 200000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    b1=10; b2=15; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Nov 23 2014 *)
    Select[Range[0, 10^5], PalindromeQ[#] && # == IntegerReverse[#, 15] &] (* Robert Price, Nov 09 2019 *)

A029963 Palindromic in bases 6 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 55, 111, 141, 191, 343, 434, 777, 868, 1441, 7667, 7777, 22022, 39893, 74647, 168861, 808808, 909909, 1867681, 3097903, 4232324, 4265624, 4298924, 4516154, 4565654, 4598954, 4849484, 5100015, 5182815, 5400045
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; Select[ Range[10^7], palQ[ #, 6] && palQ[ #, 10] &] (* Robert G. Wilson v Sep 30 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 6] &] (* Robert Price, Nov 09 2019 *)

A029967 Palindromic in bases 12 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 181, 555, 616, 676, 737, 797, 1111, 8008, 35953, 43934, 88888, 646646, 3192913, 5641465, 8364638, 9963699, 133373331, 139979931, 293373392, 520020025, 713171317, 796212697, 1393223931
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 10^5], PalindromeQ[#] && # == IntegerReverse[#, 12] &] (* Robert Price, Nov 09 2019 *)
  • Python
    from gmpy2 import digits
    def palQ(n,b): # check if n is a palindrome in base b
        s = digits(n,b)
        return s == s[::-1]
    def palQgen10(l): # generator of palindromes in base 10 of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[-2::-1])
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[::-1])
    A029967_list = [n for n in palQgen10(5) if palQ(n,12)] # Chai Wah Wu, Dec 01 2014

A029968 Palindromic in bases 13 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 222, 313, 353, 444, 575, 666, 797, 1111, 6776, 8778, 24542, 25452, 26362, 56265, 311113, 2377732, 2713172, 2832382, 2906092, 8864688, 10122101, 13055031, 20244202, 20944902, 23177132, 23877832
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 13], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 13] &] (* Robert Price, Nov 09 2019 *)
  • Python
    from gmpy2 import digits
    def palQ(n,b): # check if n is a palindrome in base b
        s = digits(n,b)
        return s == s[::-1]
    def palQgen10(l): # generator of palindromes in base 10 of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[-2::-1])
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[::-1])
    A029968_list = [n for n in palQgen10(9) if palQ(n,13)]
    # Chai Wah Wu, Dec 01 2014
Showing 1-10 of 55 results. Next