login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


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

1,2

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

FORMULA

n>0 a(2*A059009(n)+1)=0; n>0 a(n) mod 2 = 1-A059448(n); a(2^n)=n+1

MAPLE

f:= proc(n) option remember;

if n::even then procname(n/2)+1 else procname((n-1)/2) mod 2 fi

end proc:

f(1):= 1:

map(f, [$1..100]); # Robert Israel, Jan 22 2018

PROG

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

CROSSREFS

Sequence in context: A308881 A281488 A071461 * A194188 A104512 A131848

Adjacent sequences:  A091826 A091827 A091828 * A091830 A091831 A091832

KEYWORD

nonn

AUTHOR

Benoit Cloitre, Mar 09 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 24 21:54 EST 2020. Contains 332211 sequences. (Running on oeis4.)