# How many permutations with this set of rows and columns?

I have a range of possible page design layouts consisting of rows and columns in those rows. There are a maximum of 6 possible rows, and a maximum of 5 possible columns per row.

How many unique permutations of rows and columns are there, presuming that the columns are always equally spaced, so that there are only 5 column options per row?

Here are two examples of permutations:

Row 1: 4 columns
Row 2: 3 columns
Row 3: 5 columns

Row 1: 1 column
Row 2: 2 columns
Row 3: 2 columns
Row 4: 2 columns
Row 5: 2 columns
Row 6: 2 columns


What would be doubly helpful would be pseudocode for printing out all the variations! Thanks!

-

If there are $i$ rows, then there are $5^i$ different layouts.
For example, if there are two rows, then there are 5 choices for the number of columns in row 1 and 5 choices for the number of columns in row two; so there are $5^2$ layouts when you have two rows.
So, the total number of layouts is $$5 + 5^2+ 5^3+ 5^4+ 5^5+ 5^6.$$