TITLE: Writing numbers as a sum of $2$'s and $3$'s
QUESTION [5 upvotes]: Is there a way to count the number of ways a positive integer $n$, can be written as a sum of twos and threes? Are there any patterns? Re-arranging the twos and threes are distinct..(makes sense right?? or should they not be distinct)
I stumbled apon this question from a friend who wanted to test me, and quite frankly, i cant figure it out.
I've got another twist on the question that I may need some help with: What numbers have the number of ways for a positive integer $n$ to be written as a sum of $2$'s and $3$'s = $n$?

REPLY [4 votes]: I can help find a generating function, but judging from my first impressions this is not a simple problem.
Let us consider an infinite sum. We treat $x$ as a "dummy" variable, and consider only the coefficient in front of this. 
$$\sum_{n=0}^\infty s(n)x^n$$
Where $s(n)$ denotes the value of the amount of ways to create a number as a sum of 3's and 2's. We then find that we can reduce this by the properties of infinite geometric series. If you are a stickler for analysis, go ahead and assume $|x|<1$. We can recreate this sum as an infinite product (this concept of a generating function was a great insight by Euler when he did his initial work on the theory of partitions).
$$\sum_{n=0}^\infty s(n)x^n = \frac{1}{(1-x^{2})(1-x^{3})}$$
If you expanded this series, the coefficient in front of $x^n$ would be the value that you are looking for, for some integer $n$.
The principles behind this are not too complicated but I realize that this probably doesn't make sense since I did not completely formalize this. However, expanding this series, I can give you some values. You said you used a brute force method on this, so, you can check with my values.
$s(2) = 1$ (obvious)
.
.
.
$s(16)$ = 3
.
.
.
$s(94)$ = 16
If you want to check values for yourself, check this out and expand the Taylor series.