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.

A111113 a(2^m) = 1, a(2^m+1) = -1 (m>0), otherwise a(n) = 0.

Original entry on oeis.org

0, 0, 1, -1, 1, -1, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Oct 15 2005

Keywords

Examples

			G.f. = x^2 - x^3 + x^4 - x^5 + x^8 - x^9 + x^16 - x^17 + x^32 - x^33 + ...
		

Programs

  • PARI
    {a(n) = if( n<2, 0, [1, -1, 0] [1 + min(2, n - 2^(length(binary(n)) - 1))] )} /* Michael Somos, Aug 03 2009 */
    
  • PARI
    {a(n) = if( n<2, 0, if( n%2, -a(n - 1), n == 2^valuation(n, 2)))} /* Michael Somos, Aug 03 2009 */

Formula

Euler transform of A079559 is sequence offset -1. - Michael Somos, Aug 03 2009
G.f.: (1 - x) * (Sum_{k>0} x^(2^k)). - Michael Somos, Aug 03 2009
|a(n)| = A001683(n)(mod 2) for n > 1. - John M. Campbell, Apr 01 2018