<s>[INST] Number of solution of Frobenius equation Oke I am trying to find all presentable of a number $n$ as sum $ax+(a+1)y$ where $a=0,1,\ldots$ and $x,y\geq0$ are integers. 
I find that
$5=1+1+1+1+1=1+1+1+2=1+2+2=2+3=5$ so we have $5$ ways.
$7=1+1+1+1+1+1+1=1+1+1+1+1+2=1+1+1+2+2=1+2+2+2=2+2+3=3+4$ so we have $7$ ways.
I suppose that if $p\geq3$ is a prime number then there are exactly $p$ ways. However, I found that
$11=1+1+1+1+1+1+1+1+1+1+1=1+1+1+1+1+1+1+1+1+2=1+1+1+1+1+1+1+2+2=1+1+1+1+1+2+2+2=1+1+1+2+2+2+2=1+2+2+2+2+2$
and
$=2+2+2+2+3=2+3+3+3=3+4+4 =11$ so there are only $10$ ways. 
My question are that: What is the formula for the number ways to preprent a prime $p$ to sum of $x$ numbers $a$ and $y$ numbers $a+1$ where $a,x,y$ are non-negative integers?
 [/INST] The problem is slightly misstated; what you're actually counting is the number of different ways to write $n=ax+(a+1)y$ with $a,x\ge1$ and $y\ge0$, not $a,x,y\ge0$.  Changing the lower limit on $a$ and $x$ rules out what would otherwise be an infinite number of solutions, $(a,x,y)=(0,x,n)$ with $x=0,1,2,\ldots$, as well as double counting the sum $n=1+1+\cdots+1$ as $(0,1,n)$ and $(1,n,0)$ and the "sum" $n=n$ as $(n-1,0,1)$ and $(n,1,0)$.
With this in mind, note that
$$n=ax+(a+1)y=a(x+y)+y=au+y$$
where $u=x+y$ is strictly greater than $y$ (since $x\ge1$). But this means $y$ is the remainder when you divide $u$ into $n$.  So now it's clear what's happening:  for each value $u=1,2,3,\ldots$, there is precisely one way to write $n=au+y$ with $0\le y\lt u$.  But if $u\gt n$, we have $a=0$.  So there are precisely $n$ ways to write $n=au+y$ with $a\ge1$ and $0\le y\lt u$, and these translate into precisely $n$ ways to write $n=a(x+y)+y$ with $a,x\ge1$ and $y\ge0$.   
</s>