login
This site is supported by donations 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

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

Index entries for sequences related to binary expansion of n

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

Adjacent sequences:  A230626 A230627 A230628 * A230630 A230631 A230632

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 21 02:05 EST 2018. Contains 299388 sequences. (Running on oeis4.)