OFFSET
1,1
COMMENTS
For each n >= 1 the n X n matrix Z(n) is constructed as follows. The i-th row of Z(n) is obtained by generating a hexagonal array of numbers with 2*n+1 rows, 2*n numbers in the odd numbered rows and 2*n+1 numbers in the even numbered rows. The first row is all 0's except for two 1's in the i-th and the (2*n+1-i)th positions. The remaining rows are generated using the same rule for generating Pascal's triangle. The i-th row of Z(n) then consists of the first n numbers in the bottom row of our array.
For example the top row of Z(2) is [5,5], found from the array:
. 1 0 0 1
1 1 0 1 1
. 2 1 1 2
2 3 2 3 2
. 5 5 5 5
Zigzag matrices have remarkable properties. Here is a selection:
1) Z(n) is symmetric.
2) det(Z(n)) = A085527(n).
3) tr(Z(n)) = A033876(n-1).
4) If 2*n+1 is a power of a prime p then all entries of Z(n) are multiples of p.
5) If 4*n+1 is a power of a prime p then the dot product of any two distinct rows of Z(n) is a multiple of p.
6) It is always possible to move from the bottom left entry of Z(n) to the top right entry using only rightward and upward moves and visiting only odd numbers.
LINKS
Reinhard Zumkeller, Matrices Z(n): n = 1..30, flattened
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).
EXAMPLE
The first five values are 3, 5, 5, 5, 10 because the first two zigzag matrices are [[3]] and [[5,5],[5,10]].
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 *)
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Paul Boddington, Oct 28 2003
STATUS
approved