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

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

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

A249156 Palindromic in bases 5 and 7.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 24, 57, 78, 114, 342, 624, 856, 1432, 10308, 12654, 27616, 100056, 537856, 593836, 769621, 1434168, 1473368, 1636104, 1823544, 1862744, 17968646, 18108296, 22412057, 34713713, 34853363, 39280254, 159690408, 663706192
Offset: 1

Views

Author

Ray Chandler, Oct 27 2014

Keywords

Comments

Intersection of A029952 and A029954.

Examples

			114 is a term since 114 = 424 base 5 and 114 = 222 base 7.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer,base_Integer]:=Block[{idn=IntegerDigits[n,base]},idn==Reverse[idn]];Select[Range[10^6]-1,palQ[#,5]&&palQ[#,7]&]
  • PARI
    isok(n) = my(df = digits(n, 5), ds = digits(n, 7)); (Vecrev(df)==df) && (Vecrev(ds)==ds); \\ Michel Marcus, Oct 31 2017
  • 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 palQgen(l,b): # unordered generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,b**l):
                s = digits(x,b)
                yield int(s+s[-2::-1],b)
                yield int(s+s[::-1],b)
    A249156_list = sorted([n for n in palQgen(8,5) if palQ(n,7)]) # Chai Wah Wu, Nov 25 2014
    

A182232 Numbers that are palindromic in bases 2 and 5.

Original entry on oeis.org

0, 1, 3, 31, 93, 119, 2709, 38937, 520831, 682341, 340134981, 7609865031, 17935304097, 26777829859, 169179279801, 567897922593, 286118927218753, 2996750083037781, 4738749440161121, 6299497017331917, 8829547069230943
Offset: 1

Views

Author

Alex Ratushnyak, Apr 19 2012

Keywords

Comments

Intersection of A006995 and A029952. - Michel Marcus, Oct 08 2014

Examples

			2709 base 2 = 101010010101 and 2709 base 5 = 41314.
		

Crossrefs

Programs

  • Mathematica
    b1 = 2; b2 = 5; lst = {}; Do[d1 = IntegerDigits[n, b1]; d2 = IntegerDigits[n, b2]; If[d1 == Reverse[d1] && d2 == Reverse[d2], AppendTo[lst, n]], {n, 1000000}]; lst (* T. D. Noe, Apr 19 2012 *)

Extensions

Term 0 prepended by Robert G. Wilson v, Oct 08 2014
a(12)-a(16) from Robert G. Wilson v, Oct 11 2014
a(17)-a(21) and b-file from Ray Chandler, Oct 24 2014

A182233 Numbers that are palindromic in bases 2 and 6.

Original entry on oeis.org

0, 1, 3, 5, 7, 21, 129, 427, 693, 819, 3999, 4257, 4593, 28539, 66433, 85093, 148617, 151497, 153513, 180213, 425971, 1040319, 1093281, 1508381, 1632995, 1974031, 1986127, 30522135, 30643095, 208080483, 1894216583, 6662648163, 8632935681
Offset: 1

Views

Author

Alex Ratushnyak, Apr 19 2012

Keywords

Comments

Intersection of A006995 and A029953. - Michel Marcus, Oct 09 2014

Examples

			85093 base 2 = 10100110001100101 and 85093 base 6 = 1453541.
		

Crossrefs

Cf. A006995 (base 2), A029953 (base 6).
Cf. A060792 (base 2 and 3), A097856 (base 2 and 4).

Programs

  • Mathematica
    b1 = 2; b2 = 6; lst = {}; Do[d1 = IntegerDigits[n, b1]; d2 = IntegerDigits[n, b2]; If[d1 == Reverse[d1] && d2 == Reverse[d2], AppendTo[lst, n]], {n, 2000000}]; lst (* T. D. Noe, Apr 19 2012 *)
  • PARI
    isok(n) = (d2=digits(n, 2)) && (d2==Vecrev(d2)) && (d6=digits(n, 6)) && (d6==Vecrev(d6)); \\ Michel Marcus, Oct 27 2014

Extensions

a(28)-a(33) and b-file from Ray Chandler, Oct 27 2014

A182234 Numbers that are palindromic in bases 2 and 7.

Original entry on oeis.org

0, 1, 3, 5, 85, 107, 257, 5049, 9201, 11253, 11757, 210099, 399171, 512607, 786435, 12916899, 19992857, 22468309, 1052109663, 15935958711, 24051338445, 37344016593, 71859215265, 72822171105, 1566399158893, 3425211644643
Offset: 1

Views

Author

Alex Ratushnyak, Apr 19 2012

Keywords

Comments

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

Examples

			786435 base 2 = 11000000000000000011 and 786435 base 7 = 6453546.
		

Crossrefs

Cf. A006995 (base 2), A029954 (base 7).
Cf. A060792 (base 2 and 3), A097856 (base 2 and 4).

Programs

  • Mathematica
    b1 = 2; b2 = 7; lst = {}; Do[d1 = IntegerDigits[n, b1]; d2 = IntegerDigits[n, b2]; If[d1 == Reverse[d1] && d2 == Reverse[d2], AppendTo[lst, n]], {n, 1000000}]; lst (* T. D. Noe, Apr 19 2012 *)

Extensions

a(19)-a(28) from Donovan Johnson, Apr 27 2012
b-file to 31 terms from Ray Chandler, Oct 27 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.
Showing 1-10 of 31 results. Next