Charcoal, 43 42 41 40 39 20 bytes
F⊕N⊞υE⮌υ⊕↨¹✂κλι¹IΣ⊟υ
Try it online! Link is to verbose version of code. Explanation: Vaguely based on @Arnauld's formula, but there's not much of it left.
F⊕N
Loop from 0
to n
. (This part of the algorithm actually works for n=0
, but it costs 1 byte to output the final result correctly.)
⊞υE⮌υ⊕↨¹✂κλι¹
Calculate the incremented sums of the upper right triangle of the reversed matrix so far and add that as the next row.
IΣ⊟υ
Output the sum of the last row.
Example:
For n=0
we don't have any thing so far so we just create an empty row. The final matrix conceptually looks like this:
0 ...
For n=1
there is only one empty row so far so its sum is zero. This results in a row of [1]
, with the matrix now like this:
0 0 ...
1 0 ...
For n=2
there are two rows. For the second row we take the sum of all of the elements but for the first row we omit the first element. Incrementing results in [2, 1]
, with the matrix now like this:
0 0 0 ...
1 0 0 ...
2 1 0 ...
For n=3
the triangle's rows are [2, 1, 0]
, [0, 0]
and [0]
, giving incremented sums of [4, 1, 1]
, with the matrix now like this:
0 0 0 0 ...
1 0 0 0 ...
2 1 0 0 ...
4 1 1 0 ...
For n=4
the triangle's rows are [4, 1, 1, 0]
, [1, 0, 0]
, [0, 0]
and [0]
, giving incremented sums of [7, 2, 1, 1]
, with the matrix now like this:
0 0 0 0 0 ...
1 0 0 0 0 ...
2 1 0 0 0 ...
4 1 1 0 0 ...
7 2 1 1 0 ...
For n=5
the triangle's rows are [7, 2, 1, 1, 0]
, [1, 1, 0, 0]
, [0, 0, 0]
, [0, 0]
and [0]
with incremented sums of [12, 3, 1, 1, 1]
, with the matrix now like this:
0 0 0 0 0 0 ...
1 0 0 0 0 0 ...
2 1 0 0 0 0 ...
4 1 1 0 0 0 ...
7 2 1 1 0 0 ...
12 3 1 1 1 0 ...
For n=6
the triangle's rows are [12, 3, 1, 1, 1, 0]
, [2, 1, 1, 0, 0]
, [1, 0, 0, 0]
, [0, 0, 0]
, [0, 0]
and [0]
with incremented sums of [19, 5, 2, 1, 1, 1]
, with the matrix now like this:
0 0 0 0 0 0 0 ...
1 0 0 0 0 0 0 ...
2 1 0 0 0 0 0 ...
4 1 1 0 0 0 0 ...
7 2 1 1 0 0 0 ...
12 3 1 1 1 0 0 ...
19 5 2 1 1 1 0 ...
The full row sums are the partition sums are desired. The first column is also A000070
.