cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A160380 a(0) = 0; for n >= 1, a(n) = number of 0's in base-4 representation of n.

Original entry on oeis.org

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
Offset: 0

Views

Author

Frank Ruskey, Jun 05 2009

Keywords

Comments

The base-4 representation of 0 is 0, and contains a single zero. - N. J. A. Sloane, Apr 26 2021

Crossrefs

Programs

  • 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
    
  • Mathematica
    Join[{0},Table[DigitCount[n,4,0],{n,110}]] (* Harvey P. Dale, Oct 18 2015 *)
  • PARI
    a(n) = #select(x->(x==0), digits(n, 4)); \\ Michel Marcus, Apr 26 2021

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)))).

Extensions

Definition clarified by Georg Fischer, Apr 26 2021