Problem B
Patrick's Triangle
Patrick is an unknown mathematician that wanted to become famous. Patrick had heard that the mathematician Blaise Pascal had became famous because of his triangle, Pascal’s triangle.
1 |
|||||||||
1 |
1 |
||||||||
1 |
2 |
1 |
|||||||
1 |
3 |
3 |
1 |
||||||
1 |
4 |
6 |
4 |
1 |
|||||
Patrick thought that if he could come up with his own triangle, Patrick’s triangle, then he maybe too would become famous. After thinking about it for a long while, he came up with the following construction:
-
Along both the left side and right side of the triangle put the triangle numbers
1
3
3
6
6
10
10
15
15
-
Fill in the inside of the triangle by adding the number above and to the left with the number above and to the right, in the same way as Pascal’s triangle is constructed.
1
3
3
6
6
6
10
12
12
10
15
22
24
22
15
Patrick knew that in order for his triangle to make him famous, he needed to make sure no one else had invented it before him. So he searched through the On-Line Encyclopedia of Integer Sequences (OEIS.org), and luckily his triangle was missing from OEIS.
Now there was just one thing left to do, to upload his
triangle to OEIS and become famous. To do this, Patrick
calculated the first
The first 6 triangle numbers. Wikimedia Commons, CC BY-SA 3.0.
Input
The first line consists of one integer
Output
For each of the
Sample Input 1 | Sample Output 1 |
---|---|
5 4 1 10 4 4 15 3 2 6 6 2 37 123456 61728 664742090 |
Correct Incorrect Correct Correct Correct |