A088961 Zigzag matrices listed entry by entry.
3, 5, 5, 5, 10, 14, 14, 7, 14, 21, 21, 7, 21, 35, 42, 48, 27, 9, 48, 69, 57, 36, 27, 57, 78, 84, 9, 36, 84, 126, 132, 165, 110, 44, 11, 165, 242, 209, 121, 55, 110, 209, 253, 220, 165, 44, 121, 220, 297, 330, 11, 55, 165, 330, 462
Offset: 1
Examples
The first five values are 3, 5, 5, 5, 10 because the first two zigzag matrices are [[3]] and [[5,5],[5,10]].
Links
- Reinhard Zumkeller, Matrices Z(n): n = 1..30, flattened
Programs
-
Haskell
a088961 n = a088961_list !! (n-1) a088961_list = concat $ concat $ map f [1..] where f x = take x $ g (take x (1 : [0,0..])) where g us = (take x $ g' us) : g (0 : init us) g' vs = last $ take (2 * x + 1) $ map snd $ iterate h (0, vs ++ reverse vs) h (p,ws) = (1 - p, drop p $ zipWith (+) ([0] ++ ws) (ws ++ [0])) -- Reinhard Zumkeller, Oct 25 2013
-
Mathematica
Flatten[Table[Binomial[2n,n+j-i]-Binomial[2n,n+i+j]+ Binomial[2n, 3n+1-i-j], {n,5},{i,n},{j,n}]] (* Harvey P. Dale, Dec 15 2011 *)
Formula
The ij entry of Z(n) is binomial(2*n, n+j-i) - binomial(2*n, n+i+j) + binomial(2*n, 3*n+1-i-j).
Comments