https://en.wikipedia.org/wiki/Lazy_caterer%27s_sequence
https://oeis.org/A000124
n² + n + 2
p = ----------
2
Using binomial coefficients:
(n + 1) (n) (n) (n)
p = 1 + ( ) = ( ) + ( ) + ( )
( 2 ) (0) (1) (2)
Example:
n = 6
Sequence: 1, 2, 4, 7, 11, 16, 22
Array index: 0, 1, 2, 3, 4, 5, 6