A formula for the number of additive partitions Can anybody tell me (in very simple words) how to generate additive partitions? I understand the sequence giving their numbers  begins with 1,1,2,3,5,7,11,15,22 etc. I have looked this up on the internet and have come across Euler's formula (and a few others), but none of them are explained in simple terms.
I should explain that I am a programmer not a mathematician. 
 A: I suppose that, as you are a programmer, there is a slight risk that you haven't encountered the concept of generating functions before (apologies if my assumption is incorrect). You would benefit greatly from reading up on the topic in order to understand the Euler pentagonal theorem and the other approaches. 
You can consult the freely available online-book generatingfunctionology by Herbert S. Wilf to study up on generating functions, it is very reader-friendly, to the point that I, as a high-school student, had no problems grasping the contents.
I won't attempt to make any proofs of the pentagonal theorem or the like simpler, because I assume you want the hard algorithms, and because knowledge of generating functions is essential to grasp the proofs. 
N.B. I assume you want to generate the sequence $p(n)=1,1,2,3,5,$ etc. If you want to generate the actual partitions, I know no better than using brute-force.
The most efficient way I know of generating the sequence is via the pentagonal number theorem by Euler. The Wikipedia-page on it is a bit "messy"/technical, so I can perfectly understand why you resorted here for an explanation. Now to make that explanation:


*

*The $n^{th}$ pentagonal number is defined as $p_n=\frac{3n^2-n}{2}$. Take this as a fact.

*The recurrence on the Wikipedia page is stated (just above the "Bijective proof" section) as $p(n)=\sum_{k}(-1)^{k-1}p(n-p_k)$, "where the summation is over all nonzero integers $k$ (positive and negative) and $g_k$  is the $k^{th}$ pentagonal number."


The second point is the basis for the solution, and it might be better explained as follows: 
$$p(n)=p(n-p_1)+p(n-p_{-1})-p(n-p_2)-p(n-p_{-2})+\ldots,$$
where the signs occur in the pattern ++--, repeated until $n<p_{\pm k}$, at which point the terms in the recursion are zero. 
This yields a nice algorithm to compute $p(n)$, if you just remember to store all computed values of $p(n)$:


*

*$p(0)=1$ //Base case

*for $n=1,2,\ldots$ //Compute p(n) in this loop

*| $temp=0$ //Here is where p(n) will end up

*| $i=1$

*| $s=1$ //This is for the +/- signs

*| while $p_i\leq n$

*| | $temp=temp+s*p(n-p_i)$

*| | if $p_{-i}\leq n$

*| | | $temp=temp+s*p(n-p_{-i})$

*| | else

*| | | break

*| | $i=i+1$

*| | $s=-s$

*| $p(n)=temp$


I tried implementing this in Python myself, it works like a charm :)
