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.

A163618 a(2*n) = 2 * a(n). a(2*n - 1) = 2 * a(n) - 2 - (-1)^n, for all n in Z.

Original entry on oeis.org

0, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 1, 2, 1, 4, 1, 2, 5, 8, 17, 18, 17, 20, 25, 26, 29, 32, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 33, 34, 33, 36, 33, 34, 37, 40, 49, 50, 49, 52, 57, 58, 61, 64, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 1, 2, 1, 4, 1, 2, 5, 8, 17
Offset: 0

Views

Author

Michael Somos, Aug 01 2009

Keywords

Comments

Integers n>=0 such that a(n) = 1 is A118113.
Fibbinary numbers (A003714) give all integers n>=0 for which a(n+1) = 1 or 2. - Michael Somos, Feb 21 2016

Examples

			G.f. = x + 2*x^2 + x^3 + 4*x^4 + x^5 + 2*x^6 + 5*x^7 + 8*x^8 + x^9 + 2*x^10 + ...
		

Crossrefs

Cf. A163617.

Programs

  • Mathematica
    Table[(-1)*BitOr[-n, -2*n], {n, 0, 50}] (* G. C. Greubel, Jul 30 2017 *)
  • PARI
    {a(n) = n=-n; -bitor(n, n<<1)};
    
  • PARI
    {a(n) = if( n==0 || n==1, n, 2 * a((n+1) \ 2) - (n%2) * (2 + (-1)^((n+1) \ 2)))};

Formula

a(n) = -A163617(-n) for all n in Z.