[Math] How to find natural solutions of an equation

diophantine equationselementary-number-theorynatural numbersproblem solving

When I'm solving problems, I'm often confronted to solving equations, and when I'm solving equations, I'm often confronted to find the natural solutions of these equations.

My actual personal insolvable problem is :
How to determine the natural solutions of an equation ? For example, let's take this rather simple equation :

$9 = a+b$

I want to solve it, knowing that $a$ and $b$ are natural numbers. How can I get all the possible answers ? Am I obliged to test every possible value for $a$ and $b$ ? I need Mathematics wisdom.

Best Answer

$a+b=9$

Notice that $(a,b)=(1,8)$ is one particular solution to the equation, and the null solution is $(-t, t)$. All the solutions in integers can be given by: $\text{particular solution + null solution} = (1,8)+ (t,-t) = \color{red}{(1+t, 8-t)}$

Since you want solutions in naturals:

$1+t > 0$ and $8-t > 0$

which is same as $\color{Red}{-1\lt t\lt 8}$

so these $t$ values give you all the solutions in naturals : $\{(1+0,8-0), (1+1,8-1), \cdots (1+7,8-7)\} \\\{(1,8), (2,7), \cdots (8,1)\} $

That's it for the example problem. Next, see if you can extend this to solving $a+b= \text{any number}$, and finally try solving the linear diophantine equation : $ax+by=c$