login
Zigzag matrices listed entry by entry.
6

%I #15 Aug 19 2015 11:59:04

%S 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,

%T 84,9,36,84,126,132,165,110,44,11,165,242,209,121,55,110,209,253,220,

%U 165,44,121,220,297,330,11,55,165,330,462

%N Zigzag matrices listed entry by entry.

%C 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.

%C For example the top row of Z(2) is [5,5], found from the array:

%C . 1 0 0 1

%C 1 1 0 1 1

%C . 2 1 1 2

%C 2 3 2 3 2

%C . 5 5 5 5

%C Zigzag matrices have remarkable properties. Here is a selection:

%C 1) Z(n) is symmetric.

%C 2) det(Z(n)) = A085527(n).

%C 3) tr(Z(n)) = A033876(n-1).

%C 4) If 2*n+1 is a power of a prime p then all entries of Z(n) are multiples of p.

%C 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.

%C 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.

%C A001700(n) = last term of last row of Z(n): a(A000330(n-1)) = A001700(n); A230585(n) = first term of first row of Z(n): a(A056520(n-1)) = A230585(n); A051417(n) = greatest common divisor of entries of Z(n). - _Reinhard Zumkeller_, Oct 25 2013

%H Reinhard Zumkeller, <a href="/A088961/b088961.txt">Matrices Z(n): n = 1..30, flattened</a>

%F 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).

%e The first five values are 3, 5, 5, 5, 10 because the first two zigzag matrices are [[3]] and [[5,5],[5,10]].

%t 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 *)

%o (Haskell)

%o a088961 n = a088961_list !! (n-1)

%o a088961_list = concat $ concat $ map f [1..] where

%o f x = take x $ g (take x (1 : [0,0..])) where

%o g us = (take x $ g' us) : g (0 : init us)

%o g' vs = last $ take (2 * x + 1) $

%o map snd $ iterate h (0, vs ++ reverse vs)

%o h (p,ws) = (1 - p, drop p $ zipWith (+) ([0] ++ ws) (ws ++ [0]))

%o -- _Reinhard Zumkeller_, Oct 25 2013

%Y Cf. A085527, A003876.

%K easy,nice,nonn,look

%O 1,1

%A _Paul Boddington_, Oct 28 2003