How to deploy all solutions of a Diophantine equation.

How to deploy all solutions of a Diophantine equation, knowing that x1, x2, x3 ... xn, and x1, x2, x3 are integers
example
3 = 1 +1 +1
3 = 2 +1 +0
3 = 2 +0 +1
3 = 1 +2 +0
3 = 1 +0 +2
3 = 0 +2 +1
3 = 0 +1 +2
3 = 3 +0 +0
3 = 0 +3 +0
3 = 0 +0 +3
Last edited on
I guess the algorithm would have to use nested for loops or recursion. Do you have to use brute force?
example:

1
2
3
4
5
6

3 = 3 + ....//occurs 1 time
3 = 2 +....//occurs 2 times
3 = 1 +....//occurs 3 times
3 = 0 +....//occurs 4 times


I am no wiz at math but this would be one way to start tackling the problem.
What do you have so far?
Last edited on
Topic archived. No new replies allowed.