Status of the Diophantine Module
I am really pleased to say that my work (proposed) with Diophantine equation is coming to an end. I have implemented all the deliverables in my project report. When the current PR gets merged into the master, I can start pushing the rest of my work. I also hope to improve the documentation during the weekend and get them in quickly. Ondrej is currently reviewing the PR. I invite all of you to go through the work and give your feedback. I am really thankful to Aaron, Pernici, Stephen and Julien for the support given so far. First of all let me give you a rough idea about the work currently not in Github.
General Pythagorean equation
A general Pythagorean equation is an equation of the form . The solutions for the equation can be given by using parameters like below,
I implemented solutions for slightly more general equation . Solutions for this equation can be constructed from the solutions of the former equation, multiplying each solution of it by .
General sum of n squares
I also implemented solutions for where is an integer. It is obvious that equation is solvable only when .
Lagrange’s four square theorem states that every non-negative number can be expressed as a sum of four squares. It is also known that every integer not in the the form can be expressed as a sum of three squares where are non-negative integers. Also any integer which doesn’t contain, in it’s canonical representation, odd powers of a prime of the form can be expressed as a sum of two squares. For example, can’t be expressed as a sum of two squares since it contains and odd power of , which is a prime of the form . But we can express as a sum of two squares.
Also, there is an interesting identity, found by Euler, known as Euler’s four square identity which can be stated as,
So, if we can represent each prime divisor of a number as a sum of four squares, we can then use this identity to construct such a representation for. This is the idea behind my implementation of representing number as a sum of four squares. When we know how to do this, we have several approaches for representing a given non-negative integer as a sum of squares. Most obvious thing to do is, represent as a sum of four squares and set other variables to zero. We can also partition into approximately groups and represent each as a sum of four squares and later combine those results. I still haven’t decided on how to do this, I would like to know the ideas of the community. I used a slightly modified version of the algorithm found in. I’ll describe the algorithm in my next blog post.
Apart from that, I did a lot of bug fixing and reviewed Pernici’s Pull request. My tests are now 2x faster after using his functions. A huge thank should go to Pernici for doing a great Job with solving quadratic congruences.
 Lagrange’s four square theorem, [online], Available: http://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem
 Integer as a sum of three squares, [online], Available: http://www.proofwiki.org/wiki/Integer_as_Sum_of_Three_Squares
 Sum of Squares, [online], Available: http://mathworld.wolfram.com/SumofSquaresFunction.html
 Euler’s four square identity, [online], Available: http://en.wikipedia.org/wiki/Euler%27s_four-square_identity
- Posted in: GSoC-2013-SymPy