Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know if a formula exists to obtain all solutions of the above Diophantine equation? All numbers integers.

Addendum: After seeing the answer from Tito Piezas III, I reconsidered the above equation and came up with an original solution that applies to two consecutive cubes when one of the cubes is equal to two squares. Solutions for three consecutive cubes exist, when the middle cube is equal to two squares, but I regret to say that I could not find a general solution for the third cube. $[(a^2+b^2) +1]^3= [a(a^2+b^2)+a]^2+[(a^2)b+b+b^3]^2+[a^2+b^2+1]^2$, all numbers positive integers and $a>b$.

share|cite|improve this question
There is a very large literature on representations as a sum of $3$ squares. A search will give many hits, including probably Grosswald's book. There is a good probabilistic algorithm for representing any (representable) $y$. – André Nicolas Aug 5 '13 at 6:56

A positive integer is the sum of three squares iff it is not of the form $4^a (8b + 7)$. Note that $j^3 \equiv j \mod 8$ if $j$ is odd. If $j$ is odd, $(2^k j)^3 = 2^{3k} j^3$: $2^{3k}$ is a power of $4$ iff $k$ is even, and $j^3 \equiv 7 \mod 8$ iff $j \equiv 7 \mod 8$. So the only cases where $x = 2^k j$ is not a solution are when $k$ is even and $j \equiv 7 \mod 8$, i.e. when $x$ itself is not a sum of three squares.

share|cite|improve this answer
I looking for parameters to obtain the values of x,a,b,c. – Vassilis Parassidis Aug 5 '13 at 6:48

For any positive integer $k>2$, the kth power of the sum of two squares is the sum of three squares,

$$x^2+y^2+z^2 = (a^2+b^2)^k$$


$$a^2(a^2+b^2)^2 + (2ab^2)^2 + (a^2-b^2)^2b^2 = (a^2+b^2)^3$$

$$(a^4-b^4)^2 + (4a^2b^2)^2 + (2ab(a^2-b^2))^2 = (a^2+b^2)^4$$

$$a^2(a^2+b^2)^4 + (4a^3b^2-4ab^4)^2 + (a^4b-6a^2b^3+b^5)^2 = (a^2+b^2)^5$$

and so on. Similarly, for $k\geq2$, the kth power of the sum of three squares is itself the sum of three squares. Thus,

$$(a^2-b^2-c^2)^2 + (2ab)^2 + (2ac)^2 = (a^2+b^2+c^2)^2$$

$$(a^3-3ab^2-3ac^2)^2 + b^2(-3a^2+b^2+c^2)^2 + c^2(-3a^2+b^2+c^2)^2 = (a^2+b^2+c^2)^3$$

and so on.

Note: For $k>2$, this does not give all solutions, but at least you have formulas. For more details, see Sums of Three Squares.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.