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.

A214560 Number of 0's in binary expansion of n^2.

Original entry on oeis.org

1, 0, 2, 2, 4, 2, 4, 3, 6, 4, 4, 2, 6, 4, 5, 4, 8, 6, 6, 4, 6, 3, 4, 7, 8, 5, 6, 4, 7, 5, 6, 5, 10, 8, 8, 6, 8, 5, 6, 4, 8, 6, 5, 4, 6, 3, 9, 8, 10, 7, 7, 7, 8, 4, 6, 5, 9, 6, 7, 5, 8, 6, 7, 6, 12, 10, 10, 8, 10, 7, 8, 6, 10, 7, 7, 4, 8, 6, 6, 8, 10, 7, 8, 5, 7
Offset: 0

Views

Author

Alex Ratushnyak, Jul 21 2012

Keywords

Comments

Conjecture: for every x>=0 there is an i such that a(n)>x for n>i.
Comment from N. J. A. Sloane, Nov 21 2013: See also the conjecture in A231898.

Crossrefs

Programs

  • Haskell
    a214560 = a023416 . a000290  -- Reinhard Zumkeller, Nov 20 2013
    
  • Maple
    A214560 := proc(n)
        A023416(n^2) ;
    end proc: # R. J. Mathar, Jul 21 2012
    # second Maple program:
    a:= n-> `if`(n=0, 1, add(1-i, i=Bits[Split](n^2))):
    seq(a(n), n=0..84);  # Alois P. Heinz, Nov 25 2024
  • Mathematica
    Join[{1},Table[DigitCount[n^2,2,0],{n,100}]] (* Harvey P. Dale, Nov 24 2024 *)
  • PARI
    vector(66,n,b=binary((n-1)^2);sum(j=1,#b,1-b[j])) /* Joerg Arndt, Jul 21 2012 */
    
  • Python
    for n in range(300):
        b = n*n
        c = 0
        while b>0:
            c += 1-(b&1)
            b//=2
        print(c+(n==0), end=', ')
    
  • Python
    def A214560(n):
        return bin(n*n)[2:].count('0') # Chai Wah Wu, Sep 03 2014

Formula

a(n) = A023416(A000290(n)).