Quadratic Diophantine equations solver - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-23T05:37:18Z http://mathoverflow.net/feeds/question/27738 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/27738/quadratic-diophantine-equations-solver Quadratic Diophantine equations solver Igor Belegradek 2010-06-10T20:09:57Z 2011-02-03T11:20:45Z <p>Is there software that helps list small solutions of the Diophantine equation $$ x_0^2=1+x_1^2+x_2^2+\cdots+ x_n^2 $$ where "small" is negotiable, but e.g. we could fix $x_0$ and and ask for the list of all solutions $x_1, \dots, x_n\in\mathbb Z$? </p> http://mathoverflow.net/questions/27738/quadratic-diophantine-equations-solver/27742#27742 Answer by Andreas RĂ¼dinger for Quadratic Diophantine equations solver Andreas RĂ¼dinger 2010-06-10T21:18:24Z 2010-06-10T21:18:24Z <p>Have you had a look on this tutorial: <a href="http://reference.wolfram.com/mathematica/tutorial/DiophantineReduce.html" rel="nofollow">http://reference.wolfram.com/mathematica/tutorial/DiophantineReduce.html</a> ? To take different values n &lt; n_max into account, a simple loop could work. </p> http://mathoverflow.net/questions/27738/quadratic-diophantine-equations-solver/54183#54183 Answer by belisarius for Quadratic Diophantine equations solver belisarius 2011-02-03T11:20:45Z 2011-02-03T11:20:45Z <p>This function in Mathematica find them all: </p> <pre><code>f[n_] := Reduce[ Total[Table[x[i]^2, {i, 1, n}]] + 1 == x[0]^2 &amp;&amp; (Table[x[i], {i, 1, 3}] /. List -&gt; LessEqual), Table[x[i], {i, 0, n}], Integers] </code></pre> <p>Invoke with: </p> <pre><code>f[1], f[3] ... etc </code></pre>