Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
Like Tree2Thanks

Math Help - Sums of integers are squares

  1. #16
    Newbie
    Joined
    Nov 2010
    Posts
    21

    Re: Sums of integers are squares

    By "getting an answer", I just mean the program finishes. I seem to be good at being unclear . Anyway, getting the solutions is trivial if we already have the triplets, at least with my algorithm. The triplets are stored in a vector and end up sorted in the end so I just have to check if 3 consecutive triplets have the same sum.

    I've discovered that the problem is about equivalent to finding the solutions to the Diophantine equation A^2+B^2+C^2 = 2D^2.
    This is becuase (a+b)+(b+c)+(a+c) = 2(a+b+c). The sum of three squares is twice a square. My algorithm focuses on finding solutions to this equation. If the equation has at least three solutions for a given D, then we can get at least one set {a,b,c,d,e,f,g,h,i} that satisfies all conditions. I prefer not to go into how I'm getting the solutions, because it's still rather bad. I'd be interested if you can come up with an efficient way to do it.
    Here is some of my program's output:

    a+b+c < 10000
    Solutions: 10
    Triplets:77
    Time: 0.005 seconds
    a+b+c < 10000000
    Solutions: 108450
    Triplets:114388
    Time: 6.126 seconds
    a+b+c < 100000000
    Solutions: 1141596
    Triplets:1161121
    Time: 630.096 seconds

    This set of 18 triplets is also worthy of note, trusting that my program didn't make any mistakes. They all sum to the same square and meet the conditions a+b, a+c, b+c is square:

    22800 23856 46369
    22800 31024 39201
    21736 33489 37800
    15184 19041 58800
    14625 38736 39664
    14064 22800 56161
    12369 33000 47656
    10656 14625 67744
    7176 16849 69000
    6000 27489 59536
    6000 42400 44625
    4816 6000 82209
    3025 6000 84000
    3025 7176 82824
    3025 16296 73704
    3025 29016 60984
    3025 41496 48504
    609 22800 69616

    There is a set of size 173 for a+b+c < 10,000,000

    Sorry for taking up so much space. I tried to fit multiple triplets on a line but the forum seems to get rid of extra spaces so I can't separate them clearly.
    Last edited by browni3141; April 12th 2012 at 01:00 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #17
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,108
    Thanks
    68

    Re: Sums of integers are squares

    Quote Originally Posted by browni3141 View Post
    a+b+c < 10000
    Solutions: 10
    Hmmm...I get 9: for these squares:
    2401, 6241, 7225, 7569(3 cases), 8281, 9025, 9604

    Which other one do you get?
    Follow Math Help Forum on Facebook and Google+

Page 2 of 2 FirstFirst 12

Similar Math Help Forum Discussions

  1. Sums of squares
    Posted in the Number Theory Forum
    Replies: 13
    Last Post: January 7th 2010, 03:17 PM
  2. Sums of squares exercise
    Posted in the Number Theory Forum
    Replies: 2
    Last Post: December 19th 2009, 01:15 PM
  3. Sums of squares of positive integers prime to n
    Posted in the Number Theory Forum
    Replies: 1
    Last Post: November 23rd 2009, 11:15 PM
  4. Help with sums of integers please.
    Posted in the Algebra Forum
    Replies: 3
    Last Post: May 2nd 2009, 09:55 AM
  5. Sums of Squares problem.
    Posted in the Number Theory Forum
    Replies: 5
    Last Post: April 7th 2008, 01:22 AM

Search Tags


/mathhelpforum @mathhelpforum