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-3 of 3 results.

A075242 Least base for which the n-th composite number whose reversal in that base is a prime, or zero if impossible.

Original entry on oeis.org

0, 2, 4, 6, 2, 2, 2, 3, 8, 3, 2, 3, 2, 2, 2, 2, 9, 2, 6, 4, 3, 2, 3, 12, 6, 3, 2, 6, 2, 3, 2, 2, 3, 2, 9, 2, 3, 2, 2, 3, 2, 12, 2, 3, 12, 3, 6, 2, 3, 10, 6, 2, 3, 10, 2, 26, 2, 27, 2, 12, 3, 2, 9, 2, 12, 2, 2, 3, 2, 3, 2, 4, 3, 2, 34, 2, 3, 2, 6, 2, 3, 2, 38, 2, 2, 3, 4, 7, 24, 2, 2, 3, 2, 3, 18, 4, 18
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Comments

Question: Other than 4, is there a composite that cannot be made a prime by base reversal? I have found none < (10^5)-th composite.

Examples

			a(1) = 0 because 4 (2) = 1 and 4 (3) = 4 and any base greater than 3 always gives the composite 4 as its base reversal. a(3) = 4 because 8 (2) = 1, 8 (3) = 8 but 8 (4) = 2 a prime.
		

Crossrefs

Programs

  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[ # ] + 1 &, n]; f[n_] := Block[{b = 2}, While[b < n && !PrimeQ[ FromDigits[ Reverse[ IntegerDigits[n, b]], b]], b++ ]; If[b != n, b, 0]]; Table[ f[ Composite[n]], {n, 1, 105}]

A075240 Smallest prime whose base-n reversal is not a prime.

Original entry on oeis.org

2, 3, 11, 5, 13, 7, 11, 29, 19, 11, 19, 13, 29, 23, 19, 17, 23, 19, 31, 29, 29, 23, 29, 37, 37, 29, 31, 29, 43, 31, 37, 37, 59, 59, 43, 37, 41, 59, 43, 41, 59, 43, 47, 47, 53, 47, 59, 61, 59, 61, 59, 53, 67, 59, 59, 59, 61, 59, 73, 61, 71, 67, 79, 71, 89, 67, 71, 101, 89
Offset: 2

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Comments

All primes show up in the sequence eventually.

Examples

			11_10 = 23_4, reverse(23) = 32, 32_4 = 14_10, so a(4) = 11 since this does not work for smaller primes.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[k = 1; While[ PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[k], n]], n]], k++ ]; a = Append[a, Prime[k]], {n, 2, 70}]; a
  • PARI
    a(n) = my(p=2); while (isprime(fromdigits(Vecrev(digits(p, n)), n)), p = nextprime(p+1)); p; \\ Michel Marcus, Mar 28 2021

A075244 Least number requiring the base n to produce a prime by base reversal.

Original entry on oeis.org

2, 3, 15, 8, 109, 9, 119, 16, 27, 70, 2197, 36, 1265, 158, 213, 178, 4205, 126, 14189, 260, 273, 304, 4865, 120, 1295, 78, 81, 532, 44323, 150, 47317, 952, 771, 102, 16705, 492, 6209, 114, 1209, 2020, 132743, 294, 22945, 2834, 2721, 2276, 66455, 144
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Comments

Question, Is every base necessary to convert the natural numbers into primes?

Examples

			a(1) = 2 because two = 11 in unary (A000042) and its reversal 11 = 2. a(2) = 3 because three = 11 in base 2 (A007088) and its reversal 11 in base 2 = 3. a(3) = 15 because fifteen = 120 in base 3 (A007089) and its reversal 21 in base 3 = 7. a(4) = 8 -> 2. a(7) = 119 because 119 base 7 = 230 in base 7 (A007093) and its reversal 32 base 7 = 161.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{b = 2}, While[b < n && !PrimeQ[ FromDigits[ Reverse[ IntegerDigits[n, b]], b]], b++ ]; If[b != n, b, 0]]; a = Table[0, {70}]; Do[b = f[n]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 2, 133000}]
Showing 1-3 of 3 results.