OFFSET
1,2
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.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
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}]
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Sep 09 2002
STATUS
approved