Developing a recurrence relation involving combinations that sum up to $a$

130 Views Asked by At

I'd like to find a recurrence relation/recursive definition that can count the total number of combinations s.t. $3x+4y+5z=a$

In other words, given a value $a$, how many sets of $x,y,z \in \mathbb{N}$ exist for such an $a$ so that the equation is true. I should mention that $\mathbb{N}$ includes the number $0$.

What I thought of doing was having a function like (I wasn't sure how to make a piecewise function):

$f(a)=0$, when $a<0$

$f(a)=1$, when $a=1$

$f(a)=f(a-3)+f(a-4)+f(a-5)$

But obviously, a counterexample pops up rather quickly so that isn't the answer.

I'd like to find a function that only uses a single parameter but is a function like this even possible?