How many matrices exist with this increasing row and increasing column condition?

Given $N$, I would like to know the number of matrices constructed from $1$ to $N$ which satisfy the following conditions:
1. Each row entry should be in increasing order.
2. Each column entry should be in increasing order.

For example: when $N = 4$, there are 4 matrices which satisfy these conditions:
1. $\left( \begin{array}{c} 1 & 2 & 3 & 4\end{array} \right) $
2. $\left( \begin{array}{c} 1 \\ 2 \\ 3 \\ 4\end{array} \right) $
3. $\left( \begin{array}{cc} 1 & 2 \\ 3 & 4\end{array} \right) $
4. $\left( \begin{array}{cc} 1 & 3 \\ 2 & 4\end{array} \right) $

My observations:
$N$ should be a composite number to construct a valid matrix.
If a matrix $A$ satisfies the condition then $A^T$ also satisfies the condition.


Solution 1:

You should read about Young Tablau and specifically the Hook Length Formula. You are asking about the number of standard Young tableau of rectangular shape. The hook length formula is precisely what you want, and is where the formula brogrenkp posted comes from.

Solution 2:

This seemed like a good one for the OEIS. I searched the first $7$ elements $(1,2,2,4,2,12,2)$.

http://oeis.org/A067228

Hopefully this will help get you started and you can justify the formula for the $Nth$ term which is given at the OEIS by Alois P. Heinz as $N! \sum_{i|N}\left(\prod_{k=0}^{\frac{n}{i}-1}\frac{k!}{(i+k)!}\right)$.