Quadratic Diophantine equations solver - MathOverflow most recent 30 from http://mathoverflow.net2013-05-23T05:37:18Zhttp://mathoverflow.net/feeds/question/27738http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/27738/quadratic-diophantine-equations-solverQuadratic Diophantine equations solverIgor Belegradek2010-06-10T20:09:57Z2011-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#27742Answer by Andreas RĂ¼dinger for Quadratic Diophantine equations solverAndreas RĂ¼dinger2010-06-10T21:18:24Z2010-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 < n_max into account, a simple loop could work. </p>
http://mathoverflow.net/questions/27738/quadratic-diophantine-equations-solver/54183#54183Answer by belisarius for Quadratic Diophantine equations solverbelisarius2011-02-03T11:20:45Z2011-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 &&
(Table[x[i], {i, 1, 3}] /. List -> LessEqual),
Table[x[i], {i, 0, n}], Integers]
</code></pre>
<p>Invoke with: </p>
<pre><code>f[1], f[3] ... etc
</code></pre>