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!)
A230629 a(0) = 0; thereafter a(n) = (1 + a(floor(n/2))) mod 3. 2
0, 1, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
For 0 < 2^i <= n < 2^(i+1), a(n) = ((i+1) mod 3).
For n >= 1, a(n) is the length of binary representation of n reduced modulo 3. - Antti Karttunen, Oct 10 2017
LINKS
FORMULA
G.f. g(z) satisfies: g(z) = z + 2*z^2 + 2*z^3 + (1 + z + ... + z^7)*g(z^8). - Robert Israel, Oct 10 2017
MAPLE
f:=proc(n) option remember; if n=0 then 0 else (1+f(floor(n/2))) mod 3; fi; end; [seq(f(n), n=0..120)];
MATHEMATICA
Join[{0}, Table[Mod[Floor[Log[2, n]] + 1, 3], {n, 80}]] (* Alonso del Arte, Oct 10 2017 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A230629 n) (if (zero? n) n (modulo (+ 1 (A230629 (/ (- n (if (even? n) 0 1)) 2))) 3))) ;; Antti Karttunen, Oct 10 2017
CROSSREFS
See A230630 for another version.
Cf. A000523.
Sequence in context: A214304 A248640 A281083 * A027359 A236109 A279279
KEYWORD
nonn
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 March 29 00:26 EDT 2024. Contains 371264 sequences. (Running on oeis4.)