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”).
%I #34 Nov 22 2023 14:24:38
%S 1,1,1,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,
%T 0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,
%U 1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
%N With respect to the dictionary ordering of words over the alphabet {a,b}, i.e., e,a,b,aa,ab,ba,bb,aaa,..., the sequence is the characteristic function of the language of words that have no consecutive b's.
%D R. G. Underwood, Fundamentals of Hopf Algebras, UTX, Springer, 2015, page 61.
%H Alois P. Heinz, <a href="/A276254/b276254.txt">Table of n, a(n) for n = 0..16383</a>
%H Michel Rigo and Robert Underwood, <a href="https://arxiv.org/abs/1712.10259">A Class of Automatic Sequences</a>, arXiv:1712.10259 [cs.FL], 2017-2018.
%F a(n) = 0 iff A007931(n) contains two (or more) consecutive 2's. - _Alois P. Heinz_, Aug 26 2016
%p a:= proc(n) local m, r, d; m, r:= n, 1;
%p while m>0 do d:= irem(m, 2, 'm');
%p if d=0 then if r=0 then return 0 fi;
%p m:= m-1 fi; r:=d;
%p od; 1
%p end:
%p seq(a(n), n=0..200); # _Alois P. Heinz_, Aug 25 2016
%t a[n_] := Module[{m, r, d}, {m, r} = {n, 1}; While[m > 0, {m, d} = QuotientRemainder[m, 2]; If[d == 0, If[r == 0, Return[0]]; m = m-1]; r = d]; 1];
%t Table[a[n], {n, 0, 200}] (* _Jean-François Alcover_, Mar 24 2018, after _Alois P. Heinz_ *)
%Y Cf. A007931.
%K nonn
%O 0
%A _Robert G. Underwood_, Aug 25 2016
%E More terms from _Alois P. Heinz_, Aug 25 2016