|
|
A337164
|
|
a(n) is the least base, other than 10, in which the decimal digits of n represent a prime, or 0 if there is no such base.
|
|
1
|
|
|
3, 4, 0, 6, 0, 8, 0, 0, 0, 2, 3, 4, 7, 6, 7, 12, 9, 14, 0, 3, 0, 4, 0, 6, 0, 8, 0, 11, 0, 4, 5, 0, 5, 6, 0, 8, 11, 0, 0, 7, 0, 5, 0, 6, 0, 9, 0, 11, 0, 6, 7, 8, 11, 0, 7, 8, 9, 14, 0, 7, 0, 0, 0, 7, 0, 9, 0, 0, 0, 16, 11, 8, 9, 8, 11, 0, 9, 14, 0, 9, 0, 13, 0, 12, 0, 9, 0, 11, 0, 12, 11, 0, 11
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|