OFFSET
0,5
LINKS
MATHEMATICA
a[n_] := Module[{k = n, p = 2, s = {}, r, i}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, AppendTo[s, r]; p = NextPrime[p]]; i = FirstPosition[s, _?(# > 1 &)]; If[MissingQ[i], 0, i[[1]]]]; Array[a, 100] (* Amiram Eldar, Mar 13 2024 *)
PROG
(PARI) A328828(n) = { my(i=1, p=2); while(n, if((n%p)>1, return(i)); i++; n = n\p; p = nextprime(1+p)); (0); };
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 29 2019
STATUS
approved