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.

A140081 Period 4: repeat [0, 1, 1, 2].

Original entry on oeis.org

0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1
Offset: 0

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 03 2008

Keywords

Comments

Also fix e = 4; then a(n) = minimal Hamming distance between the binary representation of n and the binary representation of any multiple k*e (0 <= k <= n/e) which is a child of n.
A number m is a child of n if the binary representation of n has a 1 in every position where the binary representation of m has a 1.

Crossrefs

Cf. A140201. - Reinhard Zumkeller, Feb 21 2010

Programs

Formula

a(n) = 1 + a(n - 1 - a(n-1)) + 2*a(a(n-1)) - 2*a(n-1), a(0)=0. - Ramasamy Chandramouli, Jan 31 2010
a(n) = A047624(n+2) - A047624(n+1) - 1. - Reinhard Zumkeller, Feb 21 2010
a(n) = 1 - cos(Pi*n/2)/2 - sin(Pi*n/2)/2 - (-1)^n/2. - R. J. Mathar, Oct 08 2011
a(n) = ((n mod 4) + (n mod 2))/2. - Gary Detlefs, Apr 21 2012
From Colin Barker, Jan 13 2013: (Start)
a(n) = a(n-4).
G.f.: -x*(2*x^2+x+1) / ((x-1)*(x+1)*(x^2+1)). (End)
a(n) = floor((3*(n mod 4) + 1)/4). - Wesley Ivan Hurt, Mar 27 2014
From Wesley Ivan Hurt, Apr 22 2015: (Start)
a(n) = floor(1/2 + (n mod 4)/2).
a(n) = 1 - (-1)^n/2 - (-1)^(n/2 - 1/4 + (-1)^n/4)/2. (End)
a(n) = n - floor(n/2) - 2*floor(n/4). - Ridouane Oudra, Oct 30 2019