Writing numbers as a sum of $2$'s and $3$'s 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$?
 A: 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.
A: Let $c_k$ be the number of ways that $k$ can be written as a sum of two's and three's.  If reorderings are not distinct, the problem is trivial.  By inspection, $c_0 = 1, c_1 = 0, c_2 = c_3 = c_4 = c_5 = 1$.  After that, the pattern repeats, but increasing by $1$ with each group of $6$.  That is to say,
$$
c_k = \lfloor k/6 \rfloor + c_{k \bmod 6}, \qquad k \geq 6
$$
If order matters, the problem is more complicated.  I'm not sure there's a closed-form solution for that.  I'll think about that some more.
ETA: I suspect there's a closed form.  It is specified by the recurrence relation
$$
c_k = c_{k-3} + c_{k-2}
$$
with $c_0 = 1, c_1 = 0, c_2 = 1$.  In other words, it's like the Fibonacci series, only reaching back one step further.  The justification for this recursion is that making any sum $k$ can be achieved only by first reaching either $k-3$ or $k-2$, and then adding three and two, respectively.  All sequences are distinct, so there is no recounting to worry about.
Working on the closed form now.
ETA 2: Ooh, it's messy.  Not sure this is what your friend had in mind.  The cubic corresponding to the recurrence, $r^3 - r - 1 = 0$, has some messy roots, two complex and one real.  The long-term behavior is (as you might expect) dominated by the real root, but even that value is messy:
$$
r_1 = \sqrt[3]{\frac{9-\sqrt{69}}{18}} + \sqrt[3]{\frac{9+\sqrt{69}}{18}}
    \doteq 1.32472
$$
In the limit as $k$ grows without bound, $c_k \to \alpha_1 r_1^k$, where $\alpha_1$ is some constant.  It probably converges pretty quickly.
ETA 3: The other two roots, both complex, are given by
$$
r_2 = - \frac{1-i\sqrt{3}}{2} \sqrt[3]{\frac{9-\sqrt{69}}{18}}
      - \frac{1+i\sqrt{3}}{2} \sqrt[3]{\frac{9+\sqrt{69}}{18}}
$$
$$
r_3 = - \frac{1+i\sqrt{3}}{2} \sqrt[3]{\frac{9-\sqrt{69}}{18}}
      - \frac{1-i\sqrt{3}}{2} \sqrt[3]{\frac{9+\sqrt{69}}{18}}
$$
They're complex conjugates.  The expression for $c_k$ is of the form
$$
c_k = \alpha_1 r_1^k + \alpha_2 r_2^k + \alpha_3 r_3^k
$$
Given the initial values for $k = 0, 1, 2$, we know that
$$
\alpha_1 + \alpha_2 + \alpha_3 = 1
$$
$$
\alpha_1 r_1 + \alpha_2 r_2 + \alpha_3 r_3 = 0
$$
$$
\alpha_1 r_1^2 + \alpha_2 r_2^2 + \alpha_3 r_3^2 = 1
$$
ETA 4: I did some figurings on the coefficients $\alpha_i$.  They're very messy.  Their values are approximately $\alpha_1 \doteq 0.41150, \alpha_2 \doteq 0.29425-0.13811i, \alpha_3 \doteq 0.29425+0.13811i$.
A: I'd start by just looking at how many $a$ and $b$ satisfy
$$2a + 3b = N$$
The quickest way I'd do this is by checking $N - 3b$ is even for increasingly larger $b$.
A: Without counting order ($3+3+2$ and $3+2+3$ are counted once)
In this case the question is how many pair of non negative integers $(x,y)$ are there such that $2x+3y=N$
and in this case we have:


*

*If $N=2t$ then the number of solutions is $\left\lfloor\frac{t}{3} \right\rfloor$

*If $N=2t+1$ then the number of solutions is $\left\lfloor\frac{t-1}{3} \right\rfloor$ 


In general the number of non negative solutions of $ax+by=N$ is either $\left\lfloor\frac{N}{ab} \right\rfloor$ or $\left\lfloor\frac{N}{ab} \right\rfloor-1$ 
Counting orders ($3+3+2$ and $3+2+3$ are counted as twice, considered different )
I don't know any formulas for this but we can write it as a sum:
$$\sum_{2x+3y=N}{x+y\choose x} $$
