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!)
A160380 a(0) = 0; for n >= 1, a(n) = number of 0's in base-4 representation of n. 5
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 2, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,17
COMMENTS
The base-4 representation of 0 is 0, and contains a single zero. - N. J. A. Sloane, Apr 26 2021
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) = 1+a(m), a(4m+1) = a(4m+2) = a(4m+3) = a(m).
Generating function: (1/(1-z))*Sum_{m>=0} (z^(4^(m+1))*(1 - z^(4^m))/(1 - z^(4^(m+1)))).
MATHEMATICA
Join[{0}, Table[DigitCount[n, 4, 0], {n, 110}]] (* Harvey P. Dale, Oct 18 2015 *)
PROG
(Haskell)
import Data.List (unfoldr)
a160380 = sum . map ((0 ^ ) . (`mod` 4)) .
unfoldr (\x -> if x == 0 then Nothing else Just (x, x `div` 4))
-- Reinhard Zumkeller, Apr 22 2011
(PARI) a(n) = #select(x->(x==0), digits(n, 4)); \\ Michel Marcus, Apr 26 2021
CROSSREFS
Sequence in context: A345008 A316866 A277007 * A122433 A056977 A309144
KEYWORD
nonn,base,easy
AUTHOR
Frank Ruskey, Jun 05 2009
EXTENSIONS
Definition clarified by Georg Fischer, Apr 26 2021
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 05:02 EDT 2024. Contains 371782 sequences. (Running on oeis4.)