The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A160382 Number of 2's in base-4 representation of n. 6
0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 3, 2, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,11
LINKS
F. T. Adams-Watters, F. Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS 12 (2009) 09.5.6
FORMULA
Recurrence relation: a(0) = 0, a(4m+2) = 1+a(m), a(4m) = a(4m+1) = a(4m+3) = a(m).
Generating function: (1/(1-z))*Sum_{m>=0} (z^(2*4^m)*(1 - z^(4^m))/(1 - z^(4^(m+1)))).
Morphism: 0, j -> j,j,j+1,j; e.g., 0 -> 0010 -> 0010110111210010 -> ...
PROG
(PARI) a(n) = #select(x->(x==2), digits(n, 4)); \\ Michel Marcus, Mar 24 2020
CROSSREFS
Cf. A007090.
Sequence in context: A025435 A304685 A186714 * A336352 A081221 A366988
KEYWORD
nonn,base,easy
AUTHOR
Frank Ruskey, Jun 05 2009
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 May 13 16:16 EDT 2024. Contains 372522 sequences. (Running on oeis4.)