Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
1

Solving a Diophantine system

asked 4 years ago

brennan gravatar image

I am trying to find solutions to the following Diophantine system:

a+b+c=x^2

a^2+b^2+c^2=y^2

a^3+b^3+c^3=z^2

where a,b,c are less than 5000 and where x,y,z are perfect squares

Preview: (hide)

Comments

Should x, y, z really be perfect squares?

So a+b+c, a2+b2+c2, a3+b3+c3 are perfect fourth powers?

Or did you mean a+b+c, a2+b2+c2, a3+b3+c3 are perfect squares?

If so, write one of the following:

  • a+b+c=x, a2+b2+c2=y, a3+b3+c3=z and x, y, z are perfect squares
  • a+b+c=x2, a2+b2+c2=y2, a3+b3+c3=z2 and nothing more on x, y, z
slelievre gravatar imageslelievre ( 4 years ago )

Is this homework? Is this from Project Euler?

What have you tried? What specific problem(s) are you facing?

slelievre gravatar imageslelievre ( 4 years ago )

It is not for homework, I am doing research and I am just trying to find small numerical solutions without using elliptic curves.

I do mean that a+b+c, a2+b2+c2, and a3+b3+c3 are simply perfect squares, not perfect fourths.

And i have been trying to define each as a separate equation but I cant solve for the variables within a range as integers, something like:

for a in range(5000) for b in range(5000) for c in range(5000)

eq1 = a+b+c==x^2 eq2 = a^2+b^2+c^2==y^2 eq3 = a^3+b^3+c^3==z^2

solve([eq1,eq2,eq3],a,b,c,x,y,z)

I know this is not right, I am super new to Sage, please help!

brennan gravatar imagebrennan ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

vdelecroix gravatar image

Elementary version

sage: for a in srange(1, 5000):
....:   for b in srange(1, a+1):
....:     for c in srange(1, b+1):
....:       if (a+b+c).is_square() and (a^2+b^2+c^2).is_square() and (a^3+b^3+c^3).is_square():
....:         print(a,b,c)

A little bit more elaborate

sage: for abc in srange(1, 10000):
....:   abc = abc*abc
....:   for a in srange((abc + 2)// 3, abc):
....:     for b in srange((abc - a + 1)//2, min(a, abc - a)):
....:       c = abc - a - b
....:       if (a^2+b^2+c^2).is_square() and (a^3+b^3+c^3).is_square():
....:         print(a,b,c)

From which you get the list: (129, 124, 108), (516, 496, 432), (1161, 1116, 972), (2873, 2134, 34), (2064, 1984, 1728), (3225, 3100, 2700), ...

Preview: (hide)
link

Comments

Thank you so much! It is exactly what I needed!!

brennan gravatar imagebrennan ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 4 years ago

Seen: 797 times

Last updated: Sep 13 '20