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.

A115378 a(n) = number of positive integers k < n such that n XOR k = (n+k).

Original entry on oeis.org

0, 1, 0, 3, 1, 1, 0, 7, 3, 3, 1, 3, 1, 1, 0, 15, 7, 7, 3, 7, 3, 3, 1, 7, 3, 3, 1, 3, 1, 1, 0, 31, 15, 15, 7, 15, 7, 7, 3, 15, 7, 7, 3, 7, 3, 3, 1, 15, 7, 7, 3, 7, 3, 3, 1, 7, 3, 3, 1, 3, 1, 1, 0, 63, 31, 31, 15, 31, 15, 15, 7, 31, 15, 15, 7, 15, 7, 7, 3, 31, 15, 15, 7, 15, 7, 7, 3, 15, 7, 7, 3, 7, 3
Offset: 1

Views

Author

Paul D. Hanna, Jan 21 2006

Keywords

Comments

The number of positive integers k < n such that n XOR k = (n-k) is A038573(n).

Crossrefs

Programs

  • PARI
    a(n)=sum(k=1,n,if(bitxor(n,k)==(n+k),1,0))

Formula

a(n) = -1 + 2^(number of 0's in binary expansion of n). a(n) = 2^A080791(n) - 1 = A080100(n) - 1.