OFFSET
1,5
COMMENTS
If n is composite, then there does not exist any base greater than n whose base reversal is prime. And if n is a prime, then there exist an infinite number of bases greater than n whose base reversals are primes (hence this sequence's restriction to bases up to n only).
EXAMPLE
a(5) = 3 because 5 = 101_2 and its reversal 101_2 = 5, 5 = 12_3 and its reversal 21_3 = 7, 5 = 11_4 and its reversal 11_4 = 5. 3, 7, and 5 are all primes.
MATHEMATICA
a[n_] := Block[{c = 0, b = 2}, While[b < n + 1, If[ PrimeQ[ FromDigits[ Reverse[ IntegerDigits[n, b]], b]], c++ ]; b++ ]; c]; Table[ a[n], {n, 1, 85}]
PROG
(PARI) a(n) = sum(b=2, n-1, isprime(fromdigits(Vecrev(digits(n, b)), b))); \\ Michel Marcus, Apr 29 2021
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Sep 09 2002
STATUS
approved