OFFSET
0
REFERENCES
R. G. Underwood, Fundamentals of Hopf Algebras, UTX, Springer, 2015, page 61.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16383
Michel Rigo and Robert Underwood, A Class of Automatic Sequences, arXiv:1712.10259 [cs.FL], 2017-2018.
FORMULA
a(n) = 0 iff A007931(n) contains two (or more) consecutive 2's. - Alois P. Heinz, Aug 26 2016
MAPLE
a:= proc(n) local m, r, d; m, r:= n, 1;
while m>0 do d:= irem(m, 2, 'm');
if d=0 then if r=0 then return 0 fi;
m:= m-1 fi; r:=d;
od; 1
end:
seq(a(n), n=0..200); # Alois P. Heinz, Aug 25 2016
MATHEMATICA
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];
Table[a[n], {n, 0, 200}] (* Jean-François Alcover, Mar 24 2018, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Underwood, Aug 25 2016
EXTENSIONS
More terms from Alois P. Heinz, Aug 25 2016
STATUS
approved