cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A071858 (Number of 1's in binary expansion of n) mod 3.

This page as a plain text file.
%I A071858 #42 Apr 27 2023 07:05:26
%S A071858 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,
%T A071858 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,
%U A071858 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
%N A071858 (Number of 1's in binary expansion of n) mod 3.
%C A071858 This is the generalized Thue-Morse sequence t_3 (Allouche and Shallit, p. 335).
%C A071858 Ternary sequence which is a fixed point of the morphism 0 -> 01, 1 -> 12, 2 -> 20.
%C A071858 Sequence is T^(oo)(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. - _Benoit Cloitre_, Mar 02 2009
%D A071858 J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.
%H A071858 G. C. Greubel, <a href="/A071858/b071858.txt">Table of n, a(n) for n = 0..10000</a>
%H A071858 Jin Chen, Zhixiong Wen, Wen Wu, <a href="https://arxiv.org/abs/1802.03610">On the additive complexity of a Thue-Morse like sequence</a>, arXiv:1802.03610 [math.CO], 2018.
%H A071858 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F A071858 a(n) = A010872(A000120(n)).
%F A071858 Recurrence: a(2*n) = a(n), a(2*n+1) = (a(n)+1) mod 3.
%F A071858 a(n) = A000695(n) mod 3. - _John M. Campbell_, Jul 16 2016
%t A071858 f[n_] := Mod[ Count[ IntegerDigits[n, 2], 1], 3]; Table[ f[n], {n, 0, 104}] (* Or *)
%t A071858 Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {1, 2}, 2 -> {2, 0}}] &, {0}, 7] (* _Robert G. Wilson v_ Mar 03 2005, modified May 17 2014 *)
%t A071858 Table[Mod[DigitCount[n,2,1],3],{n,0,110}] (* _Harvey P. Dale_, Jul 01 2015 *)
%o A071858 (PARI) for(n=1,200,print1(sum(i=1,length(binary(n)), component(binary(n),i))%3,","))
%o A071858 (PARI) map(d)=if(d==2,[2,0],if(d==1,[1,2],[0,1]))
%o A071858 {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
%Y A071858 Cf. A000120, A010872.
%Y A071858 Cf. A010060, A001285, A010059, A048707, A096271, A100619, A179868.
%Y A071858 See A245555 for another version.
%K A071858 nonn,easy
%O A071858 0,4
%A A071858 _Benoit Cloitre_, Jun 09 2002
%E A071858 Edited by _Ralf Stephan_, Dec 11 2004