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

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

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

A250408 Palindromic in bases 10 and 20.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 252, 6556, 6776, 7117, 10101, 12621, 20202, 22722, 30303, 1784871, 1786871, 1788871, 1913191, 1915191, 1917191, 1919191, 1444884441, 334495594433, 334843348433, 355110011553, 355746647553, 10614366341601, 14102600620141, 28095922959082, 38072044027083
Offset: 1

Views

Author

Robert G. Wilson v, Nov 22 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 20) eq Reverse(Intseq(n, 20))]; // Vincenzo Librandi, Nov 23 2014
    
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 20] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
    b1=10; b2=20; 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 *)
  • 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])
    A250408_list = sorted([n for n in palQgen10(6) if palQ(n,20)])
    # Chai Wah Wu, Nov 25 2014

A250411 Palindromic in bases 10 and 27.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 252, 616, 757, 838, 919, 10301, 13031, 15951, 17871, 65856, 1197911, 2287822, 4385834, 5475745, 5549455, 6278726, 6639366, 7368637, 7573757, 8663668, 8737378, 9392939, 9466649, 9827289, 67166176, 214171412, 609808906, 836040638, 2132882312, 2487997842
Offset: 1

Views

Author

Robert G. Wilson v, Nov 23 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 27) eq Reverse(Intseq(n, 27))]; // Vincenzo Librandi, Nov 23 2014
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 27] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
    b1=10; b2=36; 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 *)

A250412 Palindromic in bases 10 and 36.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1221, 1441, 2882, 5115, 12321, 16861, 19491, 21112, 30803, 33433, 36063, 37973, 42224, 159951, 741147, 987789, 1301031, 1867681, 3315133, 4306034, 5182815, 5927295, 6918196, 6950596, 9242429, 9488849, 10066001, 48655684
Offset: 1

Views

Author

Robert G. Wilson v, Nov 23 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 36) eq Reverse(Intseq(n, 36))]; // Vincenzo Librandi, Nov 23 2014
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 36] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
    b1=10; b2=36; 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,49*10^6],PalindromeQ[#]&&IntegerDigits[#,36]== Reverse[ IntegerDigits[ #,36]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 04 2019 *)

A250409 Palindromic in bases 10 and 24.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 525, 575, 2332, 4664, 6226, 6996, 8558, 10001, 11011, 12621, 13631, 374473, 1851581, 2207022, 2267622, 2762672, 3118113, 3673763, 4029204, 4296924, 4925294, 5103015, 5836385, 6014106, 6281826, 6747476, 7132317, 7192917, 7658567, 7865687
Offset: 1

Views

Author

Robert G. Wilson v, Nov 22 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 24) eq Reverse(Intseq(n, 24))]; // Vincenzo Librandi, Nov 23 2014
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 24] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
    b1=10; b2=24; 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,79*10^5],PalindromeQ[#]&&IntegerDigits[#,24]== Reverse[ IntegerDigits[ #,24]]&] (* Harvey P. Dale, Mar 17 2023 *)

A250410 Numbers palindromic in bases 10 and 25.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 494, 626, 676, 1001, 6886, 7887, 8338, 9339, 622226, 626626, 2828282, 2859582, 3304033, 3309033, 3330333, 3335333, 3361633, 3366633, 3392933, 3397933, 6603066, 6608066, 6634366, 6639366, 8986898, 9400049, 9405049, 9431349, 9436349, 9462649, 9467649, 9493949, 9498949
Offset: 1

Views

Author

Robert G. Wilson v, Nov 22 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 25) eq Reverse(Intseq(n, 25))]; // Vincenzo Librandi, Nov 23 2014
    
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 25] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
  • 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])
    A250410_list = sorted([n for n in palQgen10(6) if palQ(n,25)])
    # Chai Wah Wu, Nov 25 2014

A259380 Palindromic numbers in bases 2 and 8 written in base 10.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 27, 45, 63, 65, 73, 195, 219, 325, 341, 365, 381, 455, 471, 495, 511, 513, 585, 1539, 1755, 2565, 2709, 2925, 3069, 3591, 3735, 3951, 4095, 4097, 4161, 4617, 4681, 12291, 12483, 13851, 14043, 20485, 20613, 20805, 20933, 21525, 21653, 21845, 21973, 23085, 23213, 23405, 23533, 24125, 24253, 24445, 24573, 28679, 28807, 28999, 29127, 29719, 29847
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 16 2015

Keywords

Examples

			2709 is in the sequence because 2709_10 = 5225_8 = 101010010101_2.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 8]; If[palQ[pp, 2], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=2; b2=8; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 30000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)

Formula

Intersection of A006995 and A029803.

A259374 Palindromic numbers in bases 3 and 5 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 26, 52, 1066, 1667, 2188, 32152, 67834, 423176, 437576, 14752936, 26513692, 27711772, 33274388, 320785556, 1065805109, 9012701786, 9256436186, 12814126552, 18814619428, 201241053056, 478999841578, 670919564984, 18432110906024, 158312796835916, 278737550525722
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 14 2015

Keywords

Comments

0 is only 0 regardless of the base,
1 is only 1 regardless of the base,
2 on the other hand is also 10 in base 2, denoted as 10_2,
3 is 3 in all bases greater than 3, but is 11_2 and 10_3.

Examples

			52 is in the sequence because 52_10 = 202_5 = 1221_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 5]; If[ palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=5; 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, Jul 15 2015 *)
  • Python
    def nextpal(n,b): # returns the palindromic successor of n in base b
        m, pl = n+1, 0
        while m > 0:
            m, pl = m//b, pl+1
        if n+1 == b**pl:
            pl = pl+1
        n = (n//(b**(pl//2))+1)//(b**(pl%2))
        m = n
        while n > 0:
            m, n = m*b+n%b, n//b
        return m
    n, a3, a5 = 0, 0, 0
    while n <= 20000:
        if a3 < a5:
            a3 = nextpal(a3,3)
        elif a5 < a3:
            a5 = nextpal(a5,5)
        else: # a3 == a5
            print(n,a3)
            a3, a5, n = nextpal(a3,3), nextpal(a5,5), n+1
    # A.H.M. Smeets, Jun 03 2019

Formula

Intersection of A014190 and A029952.

A259375 Palindromic numbers in bases 3 and 6 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 28, 80, 160, 203, 560, 644, 910, 34216, 34972, 74647, 87763, 122420, 221068, 225064, 6731644, 6877120, 6927700, 7723642, 8128762, 8271430, 77894071, 78526951, 539212009, 28476193256, 200267707484, 200316968444, 201509576804, 201669082004, 231852949304, 232018753064, 232039258376, 333349186006, 2947903946317, 5816975658914, 5817003372578, 11610051837124, 27950430282103, 81041908142188
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 14 2015

Keywords

Comments

Agrees with the number of minimal dominating sets of the halved cube graph Q_n/2 for at least n=1 to 5. - Eric W. Weisstein, Sep 06 2021

Examples

			28 is in the sequence because 28_10 = 44_6 = 1001_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 6]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=6; 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, Jul 15 2015 *)

Formula

Intersection of A014190 and A029953.
Previous Showing 11-20 of 36 results. Next