The Most Excellent Bell Number Problem (by Chris Bell)

It turns out that Mr. Bell has a formal, mathematical entity named after him. It is called the Bell Triangle. It is obviously superior to Pascal's Triangle; please don't waste our time by trying to argue the point.

Here are the first seven rows of a Bell Triangle:

[1]
[1, 2]
[2, 3, 5]
[5, 7, 10, 15]
[15, 20, 27, 37, 52]
[52, 67, 87, 114, 151, 203]
[203, 255, 322, 409, 523, 674, 877]

Because this is computer science, we will start the counting from zero. The zeroth row contains a one. Each subsequent row is filled with these two rules:

We will use the notation Brow,column to mean the Bell number from that row and column. B3,2 is 10 because to its left is a 7 and to its left and up is a 3. (Remember, we start counting rows and columns from zero!)

1. Write the method bellRow() that takes an integer input and returns that row of the Bell Triangle. The row should be in the form of an ArrayList<Integer>.

Example:

System.out.println(bellRow(0));    // prints [1]
System.out.println(bellRow(3));    // prints [5, 7, 10, 15]
System.out.println(bellRow(6));    // prints [203, 255, 322, 409, 523, 674, 877]

2. Write the method bellNum() that takes two integer inputs, a row and a column, and returns the element from that row and column in a Bell Triangle.

System.out.println(bellNum(0,0));  // prints 1
System.out.println(bellNum(3,2));  // prints 10
System.out.println(bellNum(6,3));  // prints 409