login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A140081 Period 4: repeat 0,1,1,2. 3
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 (list; graph; refs; listen; history; internal format)
OFFSET

0,4

COMMENTS

Also fix e = 4; then a(n) = minimal Hamming distance between the binary representation of n and the binary representation of any multiple ke (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.

a(n) = A047624(n+2) - A047624(n+1) - 1. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Feb 21 2010]

FORMULA

a(n)=(1/12)*{8*(n mod 4)-[(n+1) mod 4]+2*[(n+2) mod 4]-[(n+3) mod 4]}, with n>=0 - Paolo P. Lava (paoloplava(AT)gmail.com), Jun 06 2008

a(n)=1-(1/4)*(1-I)*I^n-(1/2)*(-1)^n-(1/4)*(1+I)*(-I)^n, with n>=0 and I=sqrt(-1) - Paolo P. Lava (paoloplava(AT)gmail.com), Jul 17 2008

a(n)=1+a(n-1-a(n-1))+2*a(a(n-1))-2*a(n-1), a(0)=0. -  Ramasamy Chandramouli (thedavinci(AT)gmail.com), Jan 31 2010

a(n) = 1-cos(Pi*n/2)/2 -sin(Pi*n/2)/2 -(-1)^n/2. - R. J. Mathar, Oct 08 2011

MATHEMATICA

PadLeft[{}, 100, {0, 1, 1, 2}] (* From Harvey P. Dale, Aug 19 2011 *)

PROG

See link in A140080 for Fortran program.

(PARI) a(n)=n%4-n%4\2 [From Jaume Oliver Lafont (joliverlafont(AT)gmail.com), Aug 28 2009]

CROSSREFS

A140201. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Feb 21 2010]

Sequence in context: A101660 A062984 A105243 * A112345 A124763 A029372

Adjacent sequences:  A140078 A140079 A140080 * A140082 A140083 A140084

KEYWORD

nonn

AUTHOR

Nadia Heninger (nadiah(AT)cs.princeton.edu) and N. J. A. Sloane (njas(AT)research.att.com), Jun 03 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 21:51 EST 2012. Contains 205978 sequences.