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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A091830 a(1)=1; a(2n)=(a(n)+1) mod 2, a(2n+1)=a(2n)+1. 0
1, 0, 1, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2 (list; graph; refs; listen; history; internal format)
OFFSET

1,5

COMMENTS

Parity of sum(i=1,2n-1,a(i)) = parity of n

FORMULA

a(2*A059010(n))=0; a(A059010(n))=1; a(2*A059009(n)+1)=2

Fixed point of morphism 0 -> 01, 1 -> 12, 2 -> 01.

MATHEMATICA

a[1] = 1; a[n_] := a[n] = If[ EvenQ[n], Mod[ a[n/2] + 1, 2], a[n - 1] + 1]; Table[ a[n], {n, 105}] (from Robert G. Wilson v (rgwv(at)rgwv.com), Nov 03 2005)

a[1] = 1; a[n_] := a[n] = If[ EvenQ[n], Mod[ a[n/2] + 1, 2], a[n - 1] + 1]; Table[ a[n], {n, 105}] (from Robert G. Wilson v (rgwv(at)rgwv.com), Nov 03 2005)

PROG

(PARI) a(n)=if(n<2, 1, if(n%2, (a(n-1)+1), (a(n/2)+1)%2))

CROSSREFS

Sequence in context: A091991 A108234 A153148 * A029427 A132343 A119346

Adjacent sequences:  A091827 A091828 A091829 * A091831 A091832 A091833

KEYWORD

nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Mar 09 2004

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 02:51 EST 2012. Contains 205860 sequences.