login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A160385 Number of nonzero digits in base-4 representation of n. 2
0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

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) = a(m), a(4m+1) = a(4m+2) = a(4m+3) = 1+a(m).

Generating function: (1/(1-z)) * Sum_{m>=1} (z^(4^(m-1) - z^(4^m))/(1 - z^(4^m))).

Morphism: 0, j -> j,j+1,j+1,j+1; e.g., 0 -> 0111 -> 0111122212221222 -> ...

PROG

(Haskell)

import Data.List (unfoldr)

a160385 = sum . map (signum . (`mod` 4)) .

unfoldr (\x -> if x == 0 then Nothing else Just (x, x `div` 4))

-- Reinhard Zumkeller, Apr 22 2011

CROSSREFS

Sequence in context: A294647 A077099 A276337 * A076881 A136754 A276788

Adjacent sequences:  A160382 A160383 A160384 * A160386 A160387 A160388

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 02:49 EDT 2020. Contains 337291 sequences. (Running on oeis4.)