OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) ~ c * (2*(1+sqrt(2)))^n / n^(3/2), where c = 0.01202323187423280845930143205554758... . - Vaclav Kotesovec, Sep 07 2014
EXAMPLE
a(4) = 4: UDSDSD, UDUD, UDSSDD, UUDD.
a(5) = 10: UDSDSDSD, UDUDSD, UDSSDDSD, UUDDSD, UDSDUD, UDSDSSDD, UDUSDD, UDSSDSDD, UUDSDD, UDSUDD.
MAPLE
b:= proc(x, y) option remember; `if`(y>x, 0, `if`(x=0, 1,
`if`(y>0, b(x, y-1)+b(x-1, y-1), 0)+b(x-1, y+1)))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..30);
MATHEMATICA
b[x_, y_] := b[x, y] = If[y>x, 0, If[x == 0, 1, If[y>0, b[x, y-1] + b[x-1, y-1], 0] + b[x-1, y+1]]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 18 2013
STATUS
approved