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

A137779 Number of bases (numbering systems, including unary) in which the n-th prime is a palindrome having at least two digits.

Original entry on oeis.org

1, 2, 3, 3, 2, 3, 4, 2, 3, 3, 4, 3, 3, 3, 2, 2, 3, 3, 4, 3, 4, 2, 3, 3, 3, 3, 2, 4, 4, 3, 4, 3, 2, 2, 2, 4, 4, 2, 2, 4, 2, 4, 5, 3, 4, 3, 4, 2, 4, 3, 3, 3, 4, 3, 6, 2, 2, 4, 4, 3, 2, 2, 4, 2, 5, 2, 3, 5, 2, 3, 5, 2, 2, 6, 5, 3, 2, 3, 4, 4, 4, 5, 3, 4, 2, 5, 3, 4, 4, 4, 3, 3, 4, 2, 3, 3, 3, 4, 4
Offset: 1

Views

Author

Attila Olah (jolafix(AT)gmail.com), May 06 2008, corrected May 08 2008

Keywords

Comments

Each prime p > 2 is palindrome in at least base 1 and base p-1, since p = 1*(p-1)^1 + 1*(p-1)^0 and p = 1*1^(p-1) + 1*1(p-2) + ... + 1*1^1 + 1*1^0.

Examples

			a(621) = 9 because the 621st prime (4591) is a palindrome in 9 bases: base 1, 19, 20, 24, 33, 37, 51, 54 and 4590 (4591 = 1*4590^1 + 1*4590^0).
		

Crossrefs

Programs

  • PARI
    ispal(v) = {for(i=1, #v\2, if (v[i] != v[#v-i+1], return(0));); return(1);};
    a(n) = {p = prime(n); 1 + sum(i=2, p, ispal(digits(p, i)));} \\ Michel Marcus, Sep 04 2013

Formula

a(n) = A126071(prime(n)). - Charles R Greathouse IV, Jun 19 2014

A331486 Numbers k which are emirps in more bases 1 < b < k than any previous number.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 23, 29, 31, 41, 43, 53, 67, 73, 79, 97, 113, 127, 157, 193, 223, 269, 277, 311, 379, 421, 431, 467, 487, 563, 613, 647, 743, 907, 937, 977, 1093, 1193, 1249, 1259, 1373, 1483, 1543, 1637, 1667, 1933, 2239, 2393, 2477, 2521, 2857, 2957, 3083
Offset: 1

Views

Author

Amiram Eldar, Jan 23 2020

Keywords

Comments

The corresponding numbers of bases are 0, 1, 3, 6, 8, 9, 12, 13, 17, 21, 24, ... (see the link for more values).

Examples

			2 is not emirp in any base.
5 is emirp in one base, 3: 5 is 12 in base 3, and 21 in base 3 is 7 which is also a prime.
7 is emirp in 3 bases, 3, 4, and 5.
		

Crossrefs

Programs

  • Mathematica
    emirpQ[n_, b_] := n != (rev = FromDigits[Reverse @ IntegerDigits[n, b], b]) && And @@ PrimeQ[{n, rev}];
    emirpCount[n_] := Length @ Select[Range[2, n - 1], emirpQ[n, #] &];
    seq = {}; emax = -1; Do[e1 = emirpCount[n]; If[e1 > emax, emax = e1; AppendTo[seq, n]], {n, 2, 3000}]; seq
Showing 1-2 of 2 results.