|
|
A062272
|
|
Boustrophedon transform of (n+1) mod 2.
|
|
9
|
|
|
1, 1, 2, 5, 12, 41, 152, 685, 3472, 19921, 126752, 887765, 6781632, 56126201, 500231552, 4776869245, 48656756992, 526589630881, 6034272215552, 72989204937125, 929327412759552, 12424192360405961, 174008703107274752
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
J. Millar, N. J. A. Sloane, and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory Ser. A, 76(1) (1996), 44-54 (Abstract, pdf, ps).
|
|
FORMULA
|
|
|
MATHEMATICA
|
s[n_] = Mod[n+1, 2]; t[n_, 0] := s[n]; t[n_, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k]; a[n_] := t[n, n]; Array[a, 30, 0] (* Jean-François Alcover, Feb 12 2016 *)
|
|
PROG
|
(Sage) # Generalized algorithm of L. Seidel (1877)
R = []; A = {-1:0, 0:0}
k = 0; e = 1
for i in range(n) :
Am = 1 if e == 1 else 0
A[k + e] = 0
e = -e
for j in (0..i) :
Am += A[k]
A[k] = Am
k += e
R.append(A[e*i//2])
return R
(Haskell)
a062272 n = sum $ zipWith (*) (a109449_row n) $ cycle [1, 0]
(Python)
from itertools import accumulate, islice
def A062272_gen(): # generator of terms
blist, m = tuple(), 0
while True:
yield (blist := tuple(accumulate(reversed(blist), initial=(m := 1-m))))[-1]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|