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.

A329356 The binary expansion of a(n) is the first n terms of 2 - A000002.

This page as a plain text file.
%I A329356 #29 Jan 03 2023 10:17:03
%S A329356 0,1,2,4,9,19,38,77,154,308,617,1234,2468,4937,9875,19750,39501,79003,
%T A329356 158006,316012,632025,1264050,2528101,5056203,10112406,20224813,
%U A329356 40449626,80899252,161798505,323597011,647194022,1294388045,2588776091,5177552182,10355104365
%N A329356 The binary expansion of a(n) is the first n terms of 2 - A000002.
%F A329356 a(n) = floor((1-c/2)*2^n), where c = A118270 is the Kolakoski constant. - _Lorenzo Sauras Altuzarra_, Jan 01 2023
%e A329356 a(7) = 77 has binary expansion q = {1, 0, 0, 1, 1, 0, 1}, and 2 - q is {1, 2, 2, 1, 1, 2, 1}, which is the first 7 terms of A000002.
%t A329356 kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
%t A329356 kol[n_Integer]:=If[n==0,{},Nest[kolagrow,{1},n-1]];
%t A329356 Table[FromDigits[2-kol[n],2],{n,0,30}]
%Y A329356 Cf. A118270, A329361.
%Y A329356 Replacing "2 - A000002" with "A000002 - 1" gives A329355.
%Y A329356 Initial subsequences of A000002 are A329360.
%Y A329356 Cf. A121016, A211100, A275692, A296658, A329315, A329316, A329317, A329362.
%K A329356 nonn,easy
%O A329356 0,3
%A A329356 _Gus Wiseman_, Nov 12 2019