A328581 Product of nonzero digits in primorial base expansion of n.
1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 4, 4, 4, 4, 8, 8, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 4, 4, 4, 4, 8, 8, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 6, 6, 6, 6, 12, 12, 8, 8, 8, 8, 16, 16, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6
Offset: 0
Links
Crossrefs
Programs
-
Mathematica
a[n_] := Module[{k = n, p = 2, s = 1, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, If[r > 0, s *= r]; p = NextPrime[p]]; s]; Array[a, 100, 0] (* Amiram Eldar, Mar 06 2024 *)
-
PARI
A328581(n) = { my(m=1, p=2); while(n, if(n%p, m *= (n%p)); n = n\p; p = nextprime(1+p)); (m); };
Comments