login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A267263 Number of nonzero digits in representation of n in primorial base. 31
0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 3, 4, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A001221(A276086(n)). - Antti Karttunen, Aug 21 2016
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);
A049345(n, p=2) = if(n<p, n, A049345(n\p, nextprime(p+1))*10 + n%p)
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
Cf. A060735 (positions of ones).
A060130 is an analogous sequence for the factorial base, from which this differs for the first time at n=30, where a(30) = 1, while A060130(30) = 2.
Sequence in context: A193929 A132881 A224702 * A060130 A328482 A371091
KEYWORD
nonn,base
AUTHOR
Cade Brown, Jan 12 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)