Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Mar 13 2024 01:50:34
%S 0,0,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,
%T 2,1,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,2,1,2,1,
%U 1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,2,1,1,0,1,0,3,2,2,1,2,1,2,1,1,0,1,0,2,1,1,0
%N Number of nonleading zeros in primorial base expansion of n, a(0) = 0 by convention.
%H Antti Karttunen, <a href="/A328620/b328620.txt">Table of n, a(n) for n = 0..32768</a>
%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>.
%F a(n) = A001221(A328612(n)).
%F a(n) = A079067(A276086(n)).
%F a(A002110(n)) = n for all n >= 0.
%t a[n_] := Module[{k = n, p = 2, s = 0, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, If[r == 0, s++]; p = NextPrime[p]]; s]; Array[a, 100, 0] (* _Amiram Eldar_, Mar 13 2024 *)
%o (PARI) A328620(n) = { my(s=0, p=2); while(n, s += (0==(n%p)); n = n\p; p = nextprime(1+p)); (s); };
%Y Cf. A001221, A002110, A049345, A079067, A276086, A328612, A328614, A328615, A328616.
%Y Cf. A257510 for an analogous sequence.
%K nonn,base
%O 0,7
%A _Antti Karttunen_, Oct 23 2019