OFFSET
2,1
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
EXAMPLE
a(12) = 3 because 12_3 = 5 is prime.
MAPLE
f:= proc(n) local L, b, i, x, v, p;
L:= convert(n, base, 10);
if L[1] = 0 or igcd(op(L)) > 1 or not irreduc(add(L[i]*x^(i-1), i=1..nops(L))) then return 0 fi;
b:= max(L)+1;
if b = 10 then b:= 11 fi;
v:= add(L[i]*b^(i-1), i=1..nops(L));
if isprime(v) then return b fi;
for p in numtheory:-factorset(v) do
if andmap(t -> add(L[i]*t^(i-1), i=1..nops(L)) mod p = 0, [$0..p-1]) then return 0 fi;
od;
for b from b+1 to 10^4 do
if b = 10 then next fi;
if isprime(add(L[i]*b^(i-1), i=1..nops(L))) then return b fi
od;
FAIL
end proc:
f(2):= 3: f(3):= 4: f(5):= 6: f(7):= 8:
map(f, [$2..200]);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jan 28 2021
STATUS
approved