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 31-37 of 37 results.

A171775 a(n) = smallest number M such that there exist bases b_2, b_3, ..., b_n with the property that M written in base b_k is a k-digit palindrome for all k=2..n.

Original entry on oeis.org

1, 3, 5, 52, 130, 1885, 1073741824, 4398046511104
Offset: 1

Views

Author

James G. Merickel, Dec 18 2009

Keywords

Comments

a(n) is no more than 2^[(n-1)*(n-2)] for n > 6 (and equals it for n = 7 and 8 at least). The reason for this bound is that for this number for each length from n down to 3 there is at least one power of 2, 2^k, such that in base b = 2^k-1 the binomial expansion of (b+1)^floor([(n-1)*(n-2)]/k) multiplied by the remaining small power of 2 gives a palindromic expression not requiring carries in base b. James G. Merickel, Aug 05 2015

Examples

			a(6)=1885: the bases are 1884 (1885 is 11 in base 1884), 14 (1885 is 989 in base 14), 12 (it is 1111 in base 12), 6 (it is 12421 in base 6), and 4 (it is 131131 in base 4).
		

Crossrefs

Extensions

a(7) and a(8) added by James G. Merickel, Feb 04 2010
Offset changed to 1, with corresponding addition of a(1) by James G. Merickel, Jul 24 2015
Comment corrected and explained.James G. Merickel, Aug 05 2015
Definition and example rewritten by N. J. A. Sloane, Aug 05 2015

A259381 Palindromic numbers in bases 3 and 8 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 121, 130, 203, 316, 8578, 9490, 17492, 944035, 1141652, 1276916, 1554173, 58961443, 67470916, 4099065139, 5691134677, 81452592329, 81473867465, 419572845958, 21056462595764, 363376288168081
Offset: 1

Views

Author

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

Keywords

Examples

			121 is in the sequence because 121_10 = 171_8 = 11111_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, 8]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=8; 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 17 2015 *)

Formula

Intersection of A014190 and A029803.

A259383 Palindromic numbers in bases 5 and 8 written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 18, 36, 186, 438, 2268, 2709, 11898, 18076, 151596, 228222, 563786, 5359842, 32285433, 257161401, 551366532, 621319212, 716064597, 2459962002, 5018349804, 5067084204, 7300948726, 42360367356, 139853034114, 176616961826, 469606524278, 669367713609, 1274936571666, 1284108810066, 5809320306961, 8866678870082, 11073162740322, 14952142559323, 325005646077513
Offset: 1

Views

Author

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

Keywords

Examples

			186 is in the sequence because 186_10 = 272_8 = 1221_5.
		

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, 5], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=5; b2=8; 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 17 2015 *)

Formula

Intersection of A029952 and A029803.

A259387 Palindromic numbers in bases 4 and 9 written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 5, 10, 255, 273, 373, 546, 2550, 2730, 2910, 16319, 23205, 54215, 1181729, 1898445, 2576758, 3027758, 3080174, 4210945, 9971750, 163490790, 2299011170, 6852736153, 6899910553, 160142137430, 174913133450, 204283593150, 902465909895, 1014966912315, 2292918574418, 9295288254930, 11356994802010, 11372760382810, 38244097345762
Offset: 1

Views

Author

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

Keywords

Examples

			273 is in the sequence because 273_10 = 333_9 = 10101_4.
		

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, 9]; If[palQ[pp, 4], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=4; b2=9; 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 17 2015 *)

Formula

Intersection of A014192 and A029955.

A259388 Palindromic numbers in bases 5 and 9 written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 109, 246, 282, 564, 701, 22386, 32152, 41667, 47653, 48553, 1142597, 1313858, 1412768, 1677684, 12607012902, 19671459008, 20134447808, 24208576998, 24863844904, 26358878059
Offset: 1

Views

Author

Robert G. Wilson v, Jul 16 2015

Keywords

Examples

			246 is in the sequence because 246_10 = 303_9 = 1441_5.
		

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, 9]; If[palQ[pp, 5], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=5; b2=9; 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 17 2015 *)

Formula

Intersection of A029952 and A029955.

A259389 Palindromic numbers in bases 6 and 9 written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 80, 154, 191, 209, 910, 3740, 5740, 8281, 16562, 16814, 2295481, 2300665, 2350165, 2439445, 2488945, 2494129, 2515513, 7971580, 48307924, 61281793, 69432517, 123427622, 124091822, 124443290, 55854298990, 184314116750, 185794441250, 187195815770, 327925630018, 7264479038060, 27832011695551
Offset: 1

Views

Author

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

Keywords

Examples

			209 is in the sequence because 209_10 = 252_9 = 545_6.
		

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, 9]; If[palQ[pp, 6], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=6; b2=9; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 1000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)

Formula

Intersection of A029953 and A029955.

A046477 Primes that are palindromic in bases 8 and 10.

Original entry on oeis.org

2, 3, 5, 7, 373, 13331, 30103, 1496941, 1970791
Offset: 1

Views

Author

Patrick De Geest, Aug 15 1998

Keywords

Comments

Any other terms have more than 20 digits. - Michael S. Branicky, Dec 19 2020

Examples

			373_10 = 565_8. - _Jon E. Schoenfield_, Apr 10 2021
		

Crossrefs

Programs

  • Mathematica
    Do[s = RealDigits[n, 8][[1]]; t = RealDigits[n, 10][[1]]; If[PrimeQ[n], If[FromDigits[t] == FromDigits[Reverse[t]], If[FromDigits[s] == FromDigits[Reverse[s]], Print[n]]]], {n, 1, 10^5}]
    pal810Q[p_]:=PalindromeQ[p]&&IntegerDigits[p,8]==Reverse[IntegerDigits[p,8]]; Select[ Prime[ Range[150000]],pal810Q] (* Harvey P. Dale, May 25 2023 *)
  • PARI
    is(n) = my(d=digits(n, 8), dd=digits(n)); d==Vecrev(d) && dd==Vecrev(dd)
    forprime(p=1, , if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Dec 20 2020
  • Python
    # efficiently search to large numbers
    from sympy import isprime
    from itertools import product
    def candidate_prime_pals(digits):
      ruled_out = "024568" # can't be even or multiple of 5
      midrange = [[""], "0123456789"]
      for p in product("0123456789", repeat=digits//2):
        left = "".join(p)
        if len(left):
          if left[0] in ruled_out: continue
        for middle in midrange[digits%2]:
          yield left+middle+left[::-1]
    for digits in range(1, 15):
      for p in candidate_prime_pals(digits):
        intp = int(p); octp = oct(intp)[2:]
        if octp==octp[::-1]:
          if isprime(intp):
            print(intp, end=", ") # Michael S. Branicky, Dec 19 2020
    
  • Python
    # alternate sufficient for producing terms through a(9)
    from sympy import isprime
    def ispal(n): strn = str(n); return strn==strn[::-1]
    for n in range(10**7):
      if ispal(n) and ispal(oct(n)[2:]) and isprime(n):
        print(n) # Michael S. Branicky, Dec 20 2020
    
Previous Showing 31-37 of 37 results.