OFFSET
0,6
COMMENTS
...
LINKS
Reinhard Zumkeller, Rows n = 0..119 of triangle, flattened
EXAMPLE
Triangle begins
1;
1,
1, 1;
1, 2,
2, 3, 3;
3, 6, 8,
8, 14, 17, 17;
17, 34, 48, 56,
56, 104, 138, 155, 155;
MAPLE
with(linalg):rev:=proc(a) local n, p; n:=vectdim(a): p:=i->a[n+1-i]: vector(n, p) end: ps:=proc(a) local n, q; n:=vectdim(a): q:=i->sum(a[j], j=1..i): vector(n, q) end: pss:=proc(a) local n, q; n:=vectdim(a): q:=proc(i) if i<=n then sum(a[j], j=1..i) else sum(a[j], j=1..n) fi end: vector(n+1, q) end: R[0]:=vector(1, 1): for n from 1 to 18 do if n mod 2 = 1 then R[n]:=ps(rev(R[n-1])) else R[n]:=pss(rev(R[n-1])) fi od: for n from 0 to 18 do evalm(R[n]) od; # program yields the successive rows # Emeric Deutsch, Nov 16 2004
MATHEMATICA
row[0] = row[1] = {1}; row[n_?OddQ] := Accumulate[ Reverse[ row[n-1] ] ]; row[n_?EvenQ] := (r = Accumulate[ Reverse[ row[n-1] ] ]; AppendTo[r, Last[r] ]); Flatten[ Table[ row[n], {n, 0, 13}]] (* Jean-François Alcover, Dec 16 2011 *)
PROG
(Haskell)
a099959 n k = a099959_tabl !! n !! k
a099959_row n = a099959_tabl !! n
a099959_tabl = map snd $ iterate f (False, [1]) where
f (s, xs) = (not s, if s then zs ++ [last zs] else zs)
where zs = scanl1 (+) (reverse xs)
-- Reinhard Zumkeller, Dec 28 2011
CROSSREFS
KEYWORD
nonn,tabf,nice,easy
AUTHOR
N. J. A. Sloane, Nov 13 2004
EXTENSIONS
More terms from Emeric Deutsch, Nov 16 2004
STATUS
approved