login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A137779
Number of bases (numbering systems, including unary) in which the n-th prime is a palindrome having at least two digits.
2
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,2
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.
FORMULA
a(n) = A126071(prime(n)). - Charles R Greathouse IV, Jun 19 2014
EXAMPLE
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).
PROG
(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
CROSSREFS
Sequence in context: A296611 A308661 A286104 * A191246 A248222 A107918
KEYWORD
easy,base,nonn
AUTHOR
Attila Olah (jolafix(AT)gmail.com), May 06 2008, corrected May 08 2008
STATUS
approved