|
|
A153336
|
|
Number of zig-zag paths from top to bottom of a 2n by 2n square whose color is that of the top right corner
|
|
5
|
|
|
1, 8, 52, 296, 1556, 7768, 37416, 175568, 807604, 3657464, 16357496, 72407728, 317777032, 1384524656, 5994736336, 25816193952, 110652549620, 472302724408, 2008499580504, 8513063608304, 35975584631128, 151621915797840
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (2n+1)2^(2n-2) - 2(2n-1)binomial(2n-2,n-1).
|
|
EXAMPLE
|
a(3) = (2*3 + 1)*2 ^ (2*3 - 2) - 2*(2*3 - 1) * binomial(2*3 - 2, 3 - 1) = 52. - Indranil Ghosh, Feb 19 2017
|
|
MATHEMATICA
|
Table[(2n+1) 2^(2n-2)-2(2n-1) Binomial[2n-2, n-1], {n, 1, 22}] (* Indranil Ghosh, Feb 19 2017 *)
|
|
PROG
|
(Python)
import math
def C(n, r):
....f=math.factorial
....return f(n)/f(r)/f(n-r)
....return str((2*n+1)*2**(2*n-2)-2*(2*n-1)*C(2*n-2, n-1)) # Indranil Ghosh, Feb 19 2017
(PARI) a(n) = (2*n+1)*2^(2*n-2) - 2*(2*n-1)*binomial(2*n-2, n-1); \\ Michel Marcus, Feb 19 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|