OFFSET
0,5
COMMENTS
The consecutive patterns 1010, 1100 are counted. Here 1=Up=(1,1), 0=Down=(1,-1).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Vaclav Kotesovec, Recurrence (of order 10)
FORMULA
a(n) ~ 4^n / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Jun 18 2014
EXAMPLE
a(4) = 2: 10101100, 11001010.
a(5) = 10: 1010101100, 1010110010, 1010111000, 1011001010, 1100101010, 1100110100, 1101001100, 1101011000, 1110001010, 1110010100.
Here 1=Up=(1,1), 0=Down=(1,-1).
MAPLE
b:= proc(x, y, t, s) option remember; `if`(y<0 or y>x, 0,
`if`(x=0, `if`(s={}, 1, 0), `if`(nops(s)>x, 0, add(
b(x-1, y-1+2*j, irem(2*t+j, 8), s minus {2*t+j}), j=0..1))))
end:
a:= n-> b(2*n, 0, 0, {10, 12}):
seq(a(n), n=0..30);
MATHEMATICA
b[x_, y_, t_, s_] := b[x, y, t, s] = If[y<0 || y>x, 0, If[x == 0, If[s == {}, 1, 0], If[Length[s] > x, 0, Sum[b[x - 1, y - 1 + 2 j, Mod[2t + j, 8], s ~Complement~ {2t + j}], {j, 0, 1}]]]];
a[n_] := b[2n, 0, 0, {10, 12}];
a /@ Range[0, 30] (* Jean-François Alcover, Dec 21 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 16 2014
STATUS
approved