login
A390088
a(n) is the least integer base b > 1 in which the representation of n uses only prime digits; or 0 if no such base exists.
1
0, 0, 3, 4, 0, 6, 0, 8, 3, 0, 4, 4, 5, 5, 4, 4, 7, 5, 5, 7, 6, 6, 10, 6, 7, 9, 3, 8, 13, 8, 9, 8, 6, 6, 9, 6, 11, 7, 7, 12, 7, 12, 4, 4, 13, 8, 4, 4, 9, 14, 9, 16, 9, 10, 17, 10, 15, 10, 4, 4, 11, 8, 4, 4, 17, 9, 9, 5, 5, 22, 9, 12, 10, 10, 19, 10, 13, 10, 15, 11
OFFSET
0,3
COMMENTS
a(p) > 0 for any prime p because p is the only digit in base b = p + 1.
Conjecture: Exactly the values k = 0, 1, 4, 6, 9 satisfy a(k) = 0.
EXAMPLE
a(11) = 4 because 11 is (2)(3) in base 4 where 2 and 3 are primes and there is no smaller base with that property.
a(74) = 19 because 74 is (3)(17) in base 19 where 3 and 17 are primes and there is no smaller base with that property.
MAPLE
A390088:=proc(n)
local b, k;
for b from 2 to n+1 do
k:=convert(n, 'base', b);
if select(isprime, k)=k then
return b
fi
od;
return 0
end proc;
seq(A390088(n), n=0..79);
MATHEMATICA
a[n_]:=Module[{b=2}, If[MemberQ[{0, 1, 4, 6, 9}, n], 0, b=2; While[!AllTrue[IntegerDigits[n, b], PrimeQ], b++]; b]]; Array[a, 80, 0] (* James C. McMahon, Oct 31 2025 *)
PROG
(PARI) a(n) = for(b=2, n+1, my(d=digits(n, b)); if (#select(isprime, d) == #d, return(b))); \\ Michel Marcus, Oct 29 2025
CROSSREFS
Sequence in context: A383007 A158677 A337164 * A105576 A105826 A110665
KEYWORD
nonn,base,easy
AUTHOR
Felix Huber, Oct 29 2025
STATUS
approved