OFFSET
2,1
COMMENTS
a(n) is the base-b representation of n for the smallest base b>=2 such that this base-b representation is the base-10 representation of a prime.
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
EXAMPLE
a(5) = 101 because 5 = 101_2 and 101 is prime.
MAPLE
f:= proc(n) local b, L, i, p;
for b from 2 do
L:= convert(n, base, b);
if max(L) > 9 then next fi;
p:= add(L[i]*10^(i-1), i=1..nops(L));
if isprime(p) then return p fi
od
end proc:
map(f, [$2..100]);
MATHEMATICA
a[n_]:=Module[{b=2}, While[!ContainsOnly[IntegerDigits[n, b], Range[0, 9]]||!PrimeQ[FromDigits[IntegerDigits[n, b]]], b++]; FromDigits[IntegerDigits[n, b]]]; Array[a, 65, 2] (* James C. McMahon, Sep 25 2025 *)
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, Sep 16 2025
STATUS
approved
