login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Zero-one sequence based on (3n-2): a(A016777(k))=a(k); a(A007494(k))=1-a(k); a(1)=0.
45

%I #19 Jun 28 2017 20:29:21

%S 0,1,0,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,

%T 0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,0,1,1,1,1,1,0,1,1,1,1,

%U 1,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0

%N Zero-one sequence based on (3n-2): a(A016777(k))=a(k); a(A007494(k))=1-a(k); a(1)=0.

%C Compare with the generation of the Thue-Morse sequence T=A010060 from T(2n-1)=T(n), T(2n)=1-T(n), T(1)=0.

%C Other zero-one sequences generated in this manner:

%C from triangular numbers: A189011

%C from squares: A188973

%C from pentagonal numbers: A189014

%C from hexagonal numbers: A189212

%C from Beatty [n*sqrt(2)]: A189078 and A189081

%C from cubes: A189008

%C from primes: A189141

%C from (3n): A189215 and A189222

%C from (3n-1): A189097

%C from (3n-2): A188967

%C from (4n): A189289, A189292, A189275, A189298

%H Reinhard Zumkeller, <a href="/A188967/b188967.txt">Table of n, a(n) for n = 1..10000</a>

%e Let u=A016777 and v=A007494, so that u(n)=3n-2 and v=complement(u) for n>=1. Then a is a self-generating zero-one sequence with initial value a(1)=0 and a(u(k))=a(k); a(v(k))=1-a(k).

%e a(2)=a(v(1))=1-a(1)=1

%e a(3)=a(v(2))=1-a(2)=0

%e a(4)=a(u(2))=a(2)=1.

%t u[n_] := 3n - 2; (*A016777*)

%t a[1] = 0; h = 128;

%t c = (u[#1] &) /@ Range[h];

%t d = (Complement[Range[Max[#1]], #1] &)[c]; (*A007494*)

%t Table[a[d[[n]]] = 1 - a[n], {n, 1, h - 1}];

%t Table[a[c[[n]]] = a[n], {n, 1, h}] (*A188967*)

%t Flatten[Position[%, 0]] (*A188968*)

%t Flatten[Position[%%, 1]] (*A188969*)

%o (Haskell)

%o import Data.List (transpose)

%o a188967 n = a188967_list !! (n-1)

%o a188967_list = 0 : zipWith ($)

%o (cycle [(1 -) . a188967, (1 -) . a188967, a188967])

%o (concat $ transpose [[1, 3 ..], [2, 4 ..], [2 ..]])

%o -- _Reinhard Zumkeller_, May 18 2015

%Y Cf. A188968, A188969.

%Y Cf. A257998 (partial sums), A258062 (run lengths).

%K nonn

%O 1

%A _Clark Kimberling_, Apr 14 2011