# 3rd Power Diophantine Generator

**URL:** <https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970>\
**Category:** Factual Questions\
**Created:** [September 7, 2010, 9:48pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970 "2010-09-07T21:48:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 7, 2010, 9:48pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/1 "2010-09-07T21:48:27Z")

</div>

There is a generator to create perfect pythagorean triples…3:4:5, 5:12:13…

> **[Pythagorean Triples](http://www.mathreference.com/num-zext,pt.html)**
>
> Math reference,
> characterizing the pythagorean triples.

for x^2+y^2=z^2,  
x=u^2-v^2  
y=2uv  
z=u^2+v^2  
when u and v are coprime.

For diophantine equasions of the third power

> **[Diophantine Equation--3rd Powers -- from Wolfram MathWorld](https://mathworld.wolfram.com/DiophantineEquation3rdPowers.html)**
>
> As a part of the study of Waring's problem, it is known that every positive integer is a sum of no more than 9 positive cubes (g(3)=9), that every "sufficiently large" integer is a sum of no more than 7 positive cubes (G(3)\<=7; although it is not...

is there a similar generator?

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 8, 2010, 1:43pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/2 "2010-09-08T13:43:30Z")

</div>

Isn’t equation (8) on the linked page such a beast?

---

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 8, 2010, 4:40pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/3 "2010-09-08T16:40:54Z")

</div>

On the Wolfram Mathpage? Ugh, i got lost in the alphabet soup.:rolleyes:

I figured, to generate A^3+B^3+C^3=D^3 involved defining A,B,C, and D as functions of u,v,and w, as is the case with pythagorean triples.

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 8, 2010, 6:35pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/4 "2010-09-08T18:35:43Z")

</div>

Yeah equation (8) on the Wolfram page is:

(3 x^2 + 5 x y - 5 y^2)^3 + (4 x^2 - 4 x y + 6 y^2)^3 + (5 x^2 - 5 x y - 3 y^2)^3 = (6 x^2 - 4 x y + 4 y^2)^3

So let:  
A = 3 x^2 + 5 x y - 5 y^2  
B = 4 x^2 - 4 x y + 6 y^2  
C = 5 x^2 - 5 x y - 3 y^2  
D = 6 x^2 - 4 x y + 4 y^2

(with coprime x and y if you like)

Then A^3 + B^3 +C^3 = D^3.

---

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 8, 2010, 10:04pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/5 "2010-09-08T22:04:39Z")

</div>

The reason I was wondering is…well…I’d like to take an amateur crack at the Integer Brick problem:  
[http://www.durangobill.com/IntegerBrick.html](http://www.durangobill.com/IntegerBrick.html)  
I figure, If I enter The 3rd power diophantine generator and the 2nd power diophantine (pythagorean triple) generator as variables in linear programming:

> **[Linear programming](https://en.wikipedia.org/wiki/Linear_programming)**
>
> Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships. Linear programming is a special case of mathematical programming (also known as mathematical optimization).
> More formally, linear programming is a technique for the optimization of a linear objective function, subject to linear equality and linear inequality constraints. Its fe...

[http://vinci.inesc.pt/lp/](http://vinci.inesc.pt/lp/)  
then this Great Unsolved Math Problem should become a simple, if tedious, algebra problem.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 8, 2010, 10:11pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/6 "2010-09-08T22:11:45Z")

</div>

For that, you don’t want a 3rd power Diophantine equation; you want a 2nd power one with three terms. That is, you want integers a, b, and c such that a^2 + b^2 = d^2, b^2 + c^2 = e^2, a^2 + c^2 = f^2, and a^2 + b^2 + c^2 = g^2, where d, e, f, and g are all also integers. There’s no cubes here.

---

<div class="post-metadata">

**Author:** ![dzero](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@dzero](https://boards.straightdope.com/u/dzero)\
**Post date:** [September 8, 2010, 10:48pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/7 "2010-09-08T22:48:27Z")

</div>

Sometimes you people just fuckin’ scare me.

---

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 9, 2010, 3:07am UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/8 "2010-09-09T03:07:52Z")

</div>

OK.

According to this:

> **[Pythagorean quadruple](https://en.wikipedia.org/wiki/Pythagorean_quadruple)**
>
> A Pythagorean quadruple is a tuple of integers a, b, c, and d, such that a2 + b2 + c2 = d2. They are solutions of a Diophantine equation and often only positive integer values are considered. However, to provide a more complete geometric interpretation, the integer values can be allowed to be negative and zero (thus allowing Pythagorean triples to be included) with the only condition being that d \> 0. In this setting, a Pythagorean quadruple (a, b, c, d) defines a cuboid with integer side leng A ...

The generators for A^2+B^2+C^2=D^2 are

a=2mp  
b=2np  
c=p^2-(m^2+n^2)  
d=p^2+(m^2+n^2)…given that m+n+p=( **mod 2** ) and (m,n,p)=1  
(whatever that means:confused::rolleyes:)

AND

a=2mp+2nq  
b=2np-2mq  
c=p^2+q^2-(m^2+n^2)  
d=p^2+q^2+(m^2+n^2)

So…

If having the triple and quadruple generators, AND having

A^2+B^2=D^2  
A^2+C^2=E^2  
B^2+C^2=F^2  
A^2+B^2+C^2=G^2

as the dimensions of the Brick, do we have enough information to input into a linear programming matrix?

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 9, 2010, 1:42pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/9 "2010-09-09T13:42:40Z")

</div>

You know you don’t even need the quadruple generator.

Combine:

A^2+B^2=D^2  
and  
A^2+B^2+C^2=G^2

To get:

D^2+C^2=G^2

Then you need to solve four pythagorean triples simultaneously:

A^2+B^2=D^2  
A^2+C^2=E^2  
B^2+C^2=F^2  
D^2+C^2=G^2

In fact these are equivalent to equations (5) - (8) here -\> ([Perfect Cuboid -- from Wolfram MathWorld](http://mathworld.wolfram.com/PerfectCuboid.html)).

Can I ask you what it is that you are optimizing that suggests to you that linear programming will lead to a solution?

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 9, 2010, 1:58pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/10 "2010-09-09T13:58:52Z")

</div>

Also, which of the equations posted thus far do you feel are linear?

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [September 9, 2010, 2:25pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/11 "2010-09-09T14:25:23Z")

</div>

> [@](#):
>
> The reason I was wondering is…well…I’d like to take an amateur crack at the Integer Brick problem:

One way to “solve” the Integer Brick (for integral sides and an integral body diagonal, but not necessarily face diagonals) is to realize that the square of (a + b) is a^2 +2ab + b^2. So if two sides are a and b and you arrange that the square of the third side is 2ab = c^2, the body diagonal will be a + b.  
The most obvious solution is a = 1, b = 2, c = 2, with diagonal 3 (and multiples of these), but this is not the only solution you can generate. You can also get a = 2 b = 9, c = 6 with diagonal 11, for instance. You can use this to generate an infinite number of solutions, not all of them multiples of lower-order solutions. The only trick is choosing the value of 2 ab = c^2, and the rest falls into place.

---

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 9, 2010, 3:12pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/12 "2010-09-09T15:12:19Z")

</div>

Since the problem could be stated like this:

> [@Lance\_Turbo](#):
>
> A^2+B^2=D^2  
> A^2+C^2=E^2  
> B^2+C^2=F^2  
> D^2+C^2=G^2  
> ?

I thought the solution could be arrived at with matrix mathematics, instead of linear programming:

> **[Matrix (mathematics)](https://en.wikipedia.org/wiki/Matrix_%28mathematics%29)**
>
> In mathematics, a matrix (pl.: matrices) is a rectangular array of numbers or other mathematical objects with elements or entries arranged in rows and columns, usually satisfying certain properties of addition and multiplication. 
> For example, 
> 
>   
>     
>       
>         
>           
> \[
>             
>               
>                 
> 1
>                 
>                 
> 9
>                 
>                 
> −
> 13
> ...

but obviously you must first have digits to manipulate, not algebraic variables.

I’m way over my head.

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 9, 2010, 3:26pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/13 "2010-09-09T15:26:42Z")

</div>

I halfway suspected that you were really trying to turn this into a linear algebra problem and that linear programming was a red herring. And as you’ve realized, linear algebra is used to solve (systems of) linear equations and is not really suited to this problem.

---

<div class="post-metadata">

**Author:** ![Enola\_Straight](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@Enola\_Straight](https://boards.straightdope.com/u/Enola_Straight)\
**Post date:** [September 9, 2010, 5:34pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/14 "2010-09-09T17:34:11Z")

</div>

huh.

I guess the only thing left is a spreadsheet program with a TON of memory.

Brute-force exhaustive search of every pythagorean triple with digits from 1 to a quadrillion :eek:

I believe they already searched up to 1 trillion.

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [September 9, 2010, 5:40pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/15 "2010-09-09T17:40:13Z")

</div>

> [@](#):
>
> I guess the only thing left is a spreadsheet program with a TON of memory.
> 
> Brute-force exhaustive search of every pythagorean triple with digits from 1 to a quadrillion

Not true – look at my post above. It is an infallible method of generating Pythagorean triples (quadruples?). And it doesn’t require that you test all possible triples.

I suspect that it won’t generate all possible integral pytrhagorean triples (quadruples?). But then again, the method you cite in your OP demonstrably doesn’t generate all Pythagorean triples of the form a^2 + b^2 = c^2.

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [September 9, 2010, 5:58pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/16 "2010-09-09T17:58:59Z")

</div>

> [@Enola\_Straight](#):
>
> huh.
> 
> I guess the only thing left is a spreadsheet program with a TON of memory.
> 
> Brute-force exhaustive search of every pythagorean triple with digits from 1 to a quadrillion :eek:
> 
> I believe they already searched up to 1 trillion.

Another option remains. You could prove that no solution exists. The advantage to this approach is that I strongly suspect that it is the only thing that has a non-zero probability of meeting success.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [September 9, 2010, 6:13pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/17 "2010-09-09T18:13:43Z")

</div>

> [@CalMeacham](#):
>
> But then again, the method you cite in your OP demonstrably doesn’t generate all Pythagorean triples of the form a^2 + b^2 = c^2.

The OP’s method generates all Pythagorean triples in “lowest terms”; to generate all Pythagorean triples more generally, one just takes all the multiples of these.

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [September 9, 2010, 6:23pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/18 "2010-09-09T18:23:06Z")

</div>

> [@](#):
>
> The OP’s method generates all Pythagorean triples in “lowest terms”

AFAIK, that’s true. And it generates many of the multiples of the “lowest terms”, but not all of the multiples, as I’ve demonstrated myself. Although it generates all of the lowest Pythagorean triples i know of (at least in “lowest terms”), I must admit that I don’t know that it will generate _all_ of the triples in “lowest terms”.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 9, 2010, 6:26pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/19 "2010-09-09T18:26:48Z")

</div>

> [@](#):
>
> huh.
> 
> I guess the only thing left is a spreadsheet program with a TON of memory.

You don’t need a ton of memory, so long as you have some systematic way of going through the possible solutions. You don’t have to take up memory storing one that didn’t work; you just throw it out and move on to the next candidate. And each individual candidate takes up a small amount of memory.

Now, what you _do_ need is a different way of managing your memory, since the standard integer data types aren’t large enough for numbers this big. But you can get packages to facilitate this; others have solved that problem before.

---

<div class="post-metadata">

**Author:** ![adhay](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@adhay](https://boards.straightdope.com/u/adhay)\
**Post date:** [September 9, 2010, 6:28pm UTC](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970/20 "2010-09-09T18:28:41Z")

</div>

> [@Enola\_Straight](#):
>
> The reason I was wondering is…well…I’d like to take an amateur crack at the Integer Brick problem:…  
> then this Great Unsolved Math Problem should become a simple, if tedious, algebra problem.

Gosh darn it. Last night, after a couple of drinks, I came up with a simple proof that no Integer Brick exists, QED.

It was so simple, I didn’t even bother to write it down. Needless to say, after a couple more, I wish I had. :smack:

[Next page](https://boards.straightdope.com/t/3rd-power-diophantine-generator/552970.md?page=2)
