OFFSET
1,2
COMMENTS
For n = 0 the value is ambiguous, thus the sequence starts from n=1.
LINKS
EXAMPLE
19 in primorial base (A049345) is written as "301". The least missing digit is 2, thus a(19) = 2.
MATHEMATICA
a[n_] := Module[{k = n, p = 2, s = {}, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, AppendTo[s, r]; p = NextPrime[p]]; Min[Complement[Range[0, Max[s]+1], s]]]; Array[a, 100] (* Amiram Eldar, Mar 13 2024 *)
PROG
(PARI) A329027(n) = { my(m=Map(), p=2); while(n, mapput(m, (n%p), 1); n = n\p; p = nextprime(1+p)); for(k=0, oo, if(!mapisdefined(m, k), return(k))); };
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Nov 03 2019
STATUS
approved