OFFSET
0,4
LINKS
FORMULA
EXAMPLE
a(3) = 2 because 3 written in primorial base is 11 with 2 nonzero digits.
MAPLE
a:= proc(n) local m, p, r; m, p, r:= n, 2, 0;
while m>0 do r:= r+`if`(irem(m, p, 'm')>0, 1, 0);
p:= nextprime(p)
od; r
end:
seq(a(n), n=0..100); # Alois P. Heinz, Jan 15 2016
MATHEMATICA
Table[Length[IntegerDigits[n, MixedRadix@ Prime@ Reverse@ Range@ PrimePi@ n] /. 0 -> Nothing], {n, 0, 120}] (* Michael De Vlieger, Jan 12 2016, Version 10.2 *)
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Count[f@ n, d_ /; d > 0], {n, 0, 73}] (* Michael De Vlieger, Aug 29 2016 *)
PROG
(PARI) cnz(n) = my(d = digits(n)); sum(k=1, #d, d[k]!=0);
a(n) = cnz(A049345(n)); \\ Michel Marcus, Jan 12 2016
(PARI) a(n)=my(s); forprime(p=2, , if(n%p, s++, if(n==0, return(s))); n\=p) \\ Charles R Greathouse IV, Nov 17 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Cade Brown, Jan 12 2016
STATUS
approved