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

 

Logo


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

1,4

COMMENTS

For 2^i <= n < 2^(i+1), a(n) = (i mod 3).

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..32768

Index entries for sequences related to binary expansion of n

FORMULA

a(n) = A000523(n) (mod 3). - John M. Campbell, Jul 15 2016

MAPLE

f:=proc(n) option remember; if n=1 then 0 else (1+f(floor(n/2))) mod 3; fi; end; [seq(f(n), n=1..120)];

MATHEMATICA

Fold[Append[#1, Mod[1 + #1[[Floor[#2/2]]], 3]] &, {0}, Range[2, 105]] (* Michael De Vlieger, Oct 10 2017 *)

PROG

(PARI) a(n)=logint(n, 2)%3 \\ Charles R Greathouse IV, Jul 15 2016

(Scheme, with memoization-macro definec)

(definec (A230630 n) (if (= 1 n) 0 (modulo (+ 1 (A230630 (/ (- n (if (even? n) 0 1)) 2))) 3))) ;; Antti Karttunen, Oct 10 2017

CROSSREFS

See A230629 for another version.

Cf. A000523, A030300, A030301.

Sequence in context: A128207 A180958 A295854 * A037867 A122879 A037866

Adjacent sequences:  A230627 A230628 A230629 * A230631 A230632 A230633

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Oct 30 2013

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 18:58 EDT 2018. Contains 316323 sequences. (Running on oeis4.)