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.

Previous Showing 11-20 of 47 results. Next

A029731 Palindromic in bases 10 and 16.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 353, 626, 787, 979, 1991, 3003, 39593, 41514, 90209, 94049, 96369, 98689, 333333, 512215, 666666, 749947, 845548, 1612161, 2485842, 5614165, 6487846, 9616169, 67433476, 90999909, 94355349, 94544549, 119919911
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    N:= 9: # 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),16), 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),16), y=0..9), n=10^(m-1)..10^m-1);
      fi
    od:
    Res; # Robert Israel, Nov 23 2014
  • Mathematica
    A029731Q = PalindromeQ@# && IntegerReverse[#, 16] == # &; Select[Range[10^5], A029731Q] (* JungHwan Min, Mar 02 2017 *)
    Select[Range[10^7], Times @@ Boole@ Map[# == Reverse@ # &, {IntegerDigits@ #, IntegerDigits[#, 16]}] > 0 &] (* Michael De Vlieger, Mar 03 2017 *)
  • Python
    def palQ16(n): # check if n is a palindrome in base 16
        s = hex(n)[2:]
        return s == s[::-1]
    def palQgen10(l): # unordered generator of palindromes of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,10**l):
                s = str(x)
                yield int(s+s[-2::-1])
                yield int(s+s[::-1])
    A029731_list = sorted([n for n in palQgen10(6) if palQ16(n)])
    # Chai Wah Wu, Nov 25 2014

A029962 Palindromic in bases 5 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 88, 252, 282, 626, 676, 1221, 15751, 18881, 10088001, 10400401, 27711772, 30322303, 47633674, 65977956, 808656808, 831333138, 831868138, 836131638, 836181638, 2512882152, 2596886952, 2893553982, 6761551676
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, 5], AppendTo[l, a]], {n, 200000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 5] &] (* Robert Price, Nov 09 2019 *)

A029804 Numbers that are palindromic in bases 8 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 121, 292, 333, 373, 414, 585, 3663, 8778, 13131, 13331, 26462, 26662, 30103, 30303, 207702, 628826, 660066, 1496941, 1935391, 1970791, 4198914, 55366355, 130535031, 532898235, 719848917, 799535997, 1820330281
Offset: 1

Views

Author

Keywords

Comments

Intersection of A002113 and A029803. - Michel Marcus, Nov 20 2014

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 8) eq Reverse(Intseq(n, 8))]; // Vincenzo Librandi, Nov 23 2014
    
  • Mathematica
    b1=8; b2=10; lst={}; Do[d1=IntegerDigits[n, b1];d2=IntegerDigits[n,b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 100000}]; lst (* Vincenzo Librandi, Nov 13 2014 *)
    Select[Range[0,1820331000],PalindromeQ[#]&&IntegerDigits[#,8] == Reverse[ IntegerDigits[#,8]]&] (* Harvey P. Dale, Mar 18 2019 *)
  • PARI
    isok(n) = (n==0) || ((d10=digits(n, 10)) && (d10==Vecrev(d10)) && (d8=digits(n, 8)) && (d8==Vecrev(d8))); \\ Michel Marcus, Nov 13 2014
    
  • PARI
    ispal(n,r) = my(d=digits(n,r)); d==Vecrev(d);
    for(n=0,10^7,if(ispal(n,10)&&ispal(n,8),print1(n,", "))); \\ Joerg Arndt, Nov 22 2014
    
  • Python
    def palQ8(n): # check if n is a palindrome in base 8
        s = oct(n)[2:]
        return s == s[::-1]
    def palQgen10(l): # unordered generator of palindromes of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,10**l):
                s = str(x)
                yield int(s+s[-2::-1])
                yield int(s+s[::-1])
    A029804_list = sorted([n for n in palQgen10(6) if palQ8(n)])
    # Chai Wah Wu, Nov 25 2014

Extensions

More terms from Robert G. Wilson v, Sep 30 2004
Incorrect Mathematica program deleted by N. J. A. Sloane, Sep 01 2009
Terms 33 through 36 corrected by Rick Regan (exploringbinary(AT)gmail.com), Sep 01 2009

A097855 Numbers palindromic in bases 10 and 17.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 252, 494, 545, 767, 818, 989, 2882, 4554, 61416, 94249, 177771, 256652, 335533, 1388831, 4165614, 8837388, 31744713, 102757201, 103595301, 123616321, 124454421, 207535702, 208373802, 212313212, 229232922
Offset: 1

Views

Author

Cino Hilliard, Aug 31 2004

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 17) eq Reverse(Intseq(n, 17))]; // 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, 17], AppendTo[l, a]], {n, 40000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    b1=10; b2=17; 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[#, 17] &] (* Robert Price, Nov 09 2019 *)

Extensions

More terms from Robert G. Wilson v, Sep 03 2004
Term 0 prepended by Robert G. Wilson v, Oct 07 2014

A099165 Palindromic in bases 10 and 32.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 66, 99, 363, 858, 1441, 2882, 5445, 6886, 9449, 15951, 19891, 21012, 29692, 32223, 54945, 369963, 477774, 564465, 585585, 609906, 672276, 717717, 780087, 804408, 912219, 1251521, 2639362, 3825283
Offset: 1

Views

Author

Robert G. Wilson v, Sep 30 2004

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, 32], AppendTo[l, a]], {n, 10000}]; l
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 32] &] (* 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): # unordered generator of palindromes of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,10**l):
                s = str(x)
                yield int(s+s[-2::-1])
                yield int(s+s[::-1])
    A099165_list = sorted([n for n in palQgen10(6) if palQ(n,32)])
    # Chai Wah Wu, Nov 25 2014

A048268 Smallest palindrome greater than n in bases n and n+1.

Original entry on oeis.org

6643, 10, 46, 67, 92, 121, 154, 191, 232, 277, 326, 379, 436, 497, 562, 631, 704, 781, 862, 947, 1036, 1129, 1226, 1327, 1432, 1541, 1654, 1771, 1892, 2017, 2146, 2279, 2416, 2557, 2702, 2851, 3004, 3161, 3322, 3487, 3656, 3829, 4006, 4187, 4372, 4561
Offset: 2

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

From A.H.M. Smeets, Jun 19 2019: (Start)
In the following, dig(expr) stands for the digit that represents the value of expression expr, and . stands for concatenation.
As for the naming of this sequence, the trivial 1 digit palindromes 0..dig(n-1) are excluded.
If a number m is palindromic in bases n and n+1, then m has an odd number of digits when represented in base n.
All three digit numbers in base n, that are palindromic in bases n and n+1 are given by:
101_3 22_4 for n = 3,
232_n 1.dig(n).1_(n+1)
343_n 2.dig(n-1).2_(n+1)
up to and including
dig(n-2).dig(n-1).dig(n-2)n dig(n-3).4.dig(n-3)(n+1) for n > 3, and
dig(n-1).0.dig(n-1)n dig(n-3).5.dig(n-3)(n+1) for n > 4.
Let d_L(n) be the number of integers with L digits in base n (L being odd), being palindromic in bases n and n+1, then:
d_1(n) = n for n >= 2 (see above),
d_3(n) = n-2 for n >= 5 (see above),
d_5(n) = n-1 for n >= 7 and n == 1 (mod 3),
d_5(n) = n-4 for n >= 7 and n in {0, 2} (mod 3), and
it seems that d_7(n) is of order O(n^2*log(n)) for n large enough. (End)

Examples

			a(14) = 2*14^2 + 3*14 + 2 = 436, which is 232_14 and 1e1_15.
		

Crossrefs

Programs

  • Mathematica
    Do[ k = n + 2; While[ RealDigits[ k, n + 1 ][ [ 1 ] ] != Reverse[ RealDigits[ k, n + 1 ][ [ 1 ] ] ] || RealDigits[ k, n ][ [ 1 ] ] != Reverse[ RealDigits[ k, n ][ [ 1 ] ] ], k++ ]; Print[ k ], {n, 2, 75} ]
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; f[n_] := Block[{k = n + 2}, While[ !palQ[k, n] || !palQ[k, n + 1], k++ ]; k]; Table[ f[n], {n, 2, 48}] (* Robert G. Wilson v, Sep 29 2004 *)
  • PARI
    isok(j, n) = my(da=digits(j,n), db=digits(j,n+1)); (Vecrev(da)==da) && (Vecrev(db)==db);
    a(n) = {my(j = n); while(! isok(j, n), j++); j;} \\ Michel Marcus, Nov 16 2017
    
  • PARI
    Vec(x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3 + O(x^50)) \\ Colin Barker, Jun 30 2019

Formula

a(n) = 2n^2 + 3n + 2 for n >= 4 (which is 232_n and 1n1_(n+1)).
a(n) = A130883(n+1) for n > 3. - Robert G. Wilson v, Oct 08 2014
From Colin Barker, Jun 30 2019: (Start)
G.f.: x^2*(6643 - 19919*x + 19945*x^2 - 6684*x^3 + 19*x^4) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>6.
(End)

Extensions

More terms from Robert G. Wilson v, Aug 14 2000

A171706 The first n-fold intrinsically 7-palindromic number (represented in base 10).

Original entry on oeis.org

65, 186621, 3360633
Offset: 1

Views

Author

James G. Merickel, Dec 16 2009

Keywords

Comments

Though this sequence is apt to never have many known members, its third is quite a nice coincidence for consideration.
A029965 runs just short of space to show it, and A053780 is a totally unrelated collection of palindromes that also includes 33633 in addition to 3360633.
a(4) > 10^17. - Hiroaki Yamanouchi, Aug 22 2015

Examples

			a(2)=186621 is 3555553 in base 6 and 1405041 in base 7.
a(3)=3360633 is 6281826 in base 9 and 1995991 in base 11.
		

Crossrefs

Extensions

Typo in third term corrected by James G. Merickel, Dec 18 2009

A171741 The first 3-fold intrinsically n-palindromic number (given in base ten).

Original entry on oeis.org

18, 154, 19040, 267140, 2853326516320, 3360633
Offset: 2

Views

Author

James G. Merickel, Dec 17 2009

Keywords

Comments

The large value for the 6-palindrome case, a(6)=2853326516320, has 139 as the smallest of the three bases.
Coincidentally, the following much shorter term, a(7)= 3360633, involves base 9 through 11, the conjunction of base-9 and base-10 palindromes (A029965) comes up a term short (assuming space limitations remain as they are at the beginning of 2011), and A053740 is a totally unrelated collection of palindromes that also contains 33633.
a(8) > 10^18. - Hiroaki Yamanouchi, Aug 22 2015

Examples

			a(5)=267140 is 6D4D6 in base 14, 54245 in base 15, and 29E92 in base 18.
a(7)=3360633 is 6281826 in base 9 and 1995991 in base 11.
		

Crossrefs

A099145 Numbers in base 10 that are palindromic in bases 7 and 8.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 121, 178, 235, 292, 300, 2997, 6953, 7801, 10658, 13459, 16708, 428585, 431721, 444713, 447849, 450985, 502457, 626778, 786435, 10453500, 27924649
Offset: 1

Views

Author

Robert G. Wilson v, Sep 30 2004

Keywords

Comments

Intersection of A029954 and A029803. - Michel Marcus, Oct 09 2014

Examples

			178 is in the sequence because 178_10 = 343_7 = 262_8.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[ idn]]; Select[ Range[ 150000000], palQ[ #, 7] && palQ[ #, 8] &]

A099146 Numbers in base 10 that are palindromic in bases 8 and 9.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 154, 227, 300, 373, 446, 455, 11314, 12547, 17876, 27310, 889435, 894619, 899803, 926371, 1257716, 1262900, 1268084, 1273268, 1294652, 1368461, 1373645, 1405397, 2067519, 63367795, 71877268, 98383349
Offset: 1

Views

Author

Robert G. Wilson v, Sep 30 2004

Keywords

Comments

Intersection of A029803 and A029955. - Michel Marcus, Oct 09 2014

Examples

			227 is in the sequence because 227_10 = 343_8 = 272_9.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[ idn]]; Select[ Range[ 250000000], palQ[ #, 8] && palQ[ #, 9] &]

Extensions

Term 0 prepended by Robert G. Wilson v, Oct 08 2014
Previous Showing 11-20 of 47 results. Next