Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A071858
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A071858 (Number of 1's in binary expansion of n) mod 3. +0
3
0, 1, 1, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 0, 1, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 2, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 2, 2, 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 2, 2, 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 0, 2, 0, 0, 1, 0, 1, 1, 2, 0 (list; graph; listen)
OFFSET

0,4

COMMENT

Ternary sequence which is a fixed point of the morphism 0 -> 01, 1 -> 12, 2 -> 20.

Sequence is T^(infty)(0) where T is the operator acting on any word on alphabet {0,1,2} by inserting 1 after 0, 2 after 1 and 0 after 2. For instance T(001)=010112, T(120)=122001. [From Benoit Cloitre (benoit7848c(AT)orange.fr), Mar 02 2009]

FORMULA

Recurrence: a(2n) = a(n), a(2n+1) = (a(n)+1) mod 3.

MATHEMATICA

f[n_] := Mod[ Count[ IntegerDigits[n, 2], 1], 3]; Table[ f[n], {n, 0, 104}] (* Or *)

Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {1, 2}, 2 -> {2, 0}}) ]}], {0}, 7] (from Robert G. Wilson v Mar 03 2005)

PROGRAM

(PARI) for(n=1, 200, print1(sum(i=1, length(binary(n)), component(binary(n), i))%3, ", "))

(PARI) map(d)=if(d==2, [2, 0], if(d==1, [1, 2], [0, 1]))

{m=53; v=[]; w=[0]; while(v!=w, v=w; w=[]; for(n=1, min(m, length(v)), w=concat(w, map(v[n])))); for(n=1, 2*m, print1(v[n], ", "))} - Klaus Brockhaus, Jun 23 2004

CROSSREFS

Equals A010872(A000120(n)).

Cf. A010060, A001285, A010059, A048707, A096271, A100619.

Sequence in context: A038717 A073267 A159981 this_sequence A122864 A140084 A105937

Adjacent sequences: A071855 A071856 A071857 this_sequence A071859 A071860 A071861

KEYWORD

nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Jun 09 2002

EXTENSIONS

Edited by Ralf Stephan, Dec 11 2004

page 1

Search completed in 0.003 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research