login
The OEIS is supported by the many generous donors 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
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.
Sequence in context: A306707 A180958 A295854 * A343957 A338505 A037867
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)