All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Three ways - same sum (Posted on 2016-04-14) Difficulty: 3 of 5
What is the smallest number that can be written as the sum of of 3 distinct squares in 3 ways?

What is the 2nd smallest such number?

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 3 |
The first line of each group identifies the number, then the number of ways. After that are two more numbers: the number of ways if zero is excluded as one of the squares and the number of ways if both zero and one are disallowed.


65 3 1 1
    64 1 0
    49 16 0
    36 25 4
74 3 2 1
    64 9 1
    49 25 0
    49 16 9
89 3 2 2
    64 25 0
    64 16 9
    49 36 4
90 3 2 1
    81 9 0
    64 25 1
    49 25 16
101 4 3 2
    100 1 0
    81 16 4
    64 36 1
    49 36 16
110 3 3 2
    100 9 1
    81 25 4
    49 36 25
117 3 2 1
    100 16 1
    81 36 0
    64 49 4
122 3 2 2
    121 1 0
    81 25 16
    64 49 9
125 4 2 2
    121 4 0
    100 25 0
    100 16 9
    64 36 25
126 3 3 1
    121 4 1
    100 25 1
    81 36 9
134 3 3 3
    121 9 4
    100 25 9
    81 49 4
145 3 1 1
    144 1 0
    100 36 9
    81 64 0
146 4 3 2
    121 25 0
    121 16 9
    81 64 1
    81 49 16
149 4 3 2
    144 4 1
    100 49 0
    81 64 4
    64 49 36
161 4 4 3
    144 16 1
    121 36 4
    100 36 25
    81 64 16
170 4 2 1
    169 1 0
    144 25 1
    121 49 0
    81 64 25
173 4 3 3
    169 4 0
    144 25 4
    121 36 16
    100 64 9
174 3 3 2
    169 4 1
    121 49 4
    100 49 25
181 3 2 1
    144 36 1
    100 81 0
    81 64 36
182 3 3 2
    169 9 4
    121 36 25
    100 81 1
185 5 3 3
    169 16 0
    144 25 16
    121 64 0
    100 81 4
    100 49 36
186 3 3 1
    169 16 1
    121 64 1
    121 49 16
189 4 4 4
    169 16 4
    144 36 9
    121 64 4
    100 64 25
194 5 4 3
    169 25 0
    169 16 9
    144 49 1
    121 64 9
    81 64 49
197 3 2 2
    196 1 0
    144 49 4
    100 81 16
    
To make them easier to find, repeated below are those where there must be at least three ways discounting zero as an addend:   

(within a qualifying number, disqualified ways are still shown, for completeness)
    
101 4 3 2
    100 1 0
    81 16 4
    64 36 1
    49 36 16
110 3 3 2
    100 9 1
    81 25 4
    49 36 25
126 3 3 1
    121 4 1
    100 25 1
    81 36 9
134 3 3 3
    121 9 4
    100 25 9
    81 49 4
146 4 3 2
    121 25 0
    121 16 9
    81 64 1
    81 49 16
149 4 3 2
    144 4 1
    100 49 0
    81 64 4
    64 49 36
161 4 4 3
    144 16 1
    121 36 4
    100 36 25
    81 64 16
173 4 3 3
    169 4 0
    144 25 4
    121 36 16
    100 64 9
174 3 3 2
    169 4 1
    121 49 4
    100 49 25
182 3 3 2
    169 9 4
    121 36 25
    100 81 1
185 5 3 3
    169 16 0
    144 25 16
    121 64 0
    100 81 4
    100 49 36
186 3 3 1
    169 16 1
    121 64 1
    121 49 16
189 4 4 4
    169 16 4
    144 36 9
    121 64 4
    100 64 25
194 5 4 3
    169 25 0
    169 16 9
    144 49 1
    121 64 9
    81 64 49
    
    
And if anything less than four is disallowed, here's the list:    
    
    
134 3 3 3
    121 9 4
    100 25 9
    81 49 4
161 4 4 3
    144 16 1
    121 36 4
    100 36 25
    81 64 16
173 4 3 3
    169 4 0
    144 25 4
    121 36 16
    100 64 9
185 5 3 3
    169 16 0
    144 25 16
    121 64 0
    100 81 4
    100 49 36
189 4 4 4
    169 16 4
    144 36 9
    121 64 4
    100 64 25
194 5 4 3
    169 25 0
    169 16 9
    144 49 1
    121 64 9
    81 64 49    
    
    
DefDbl A-Z
Dim crlf$, w(20, 3)


Private Sub Form_Load()
 Form1.Visible = True
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 For n = 5 To 200
   ways = 0: ct2 = 0: ct3 = 0
   sr0 = Int(Sqr(n))
   For b = sr0 To lwrlim Step -1
     DoEvents
     b2 = b * b: brem = n - b2
     For a = b - 1 To lwrlim Step -1
       a2 = a * a: arem = brem - a2
       If arem >= lwrlim And arem < a2 Then
         sr = Int(Sqr(arem) + 0.5)
         If sr * sr = arem Then
           ways = ways + 1
           If arem > 0 Then ct2 = ct2 + 1
           If arem > 1 Then ct3 = ct3 + 1
           w(ways, 1) = b2
           w(ways, 2) = a2
           w(ways, 3) = arem
         End If
       End If
     Next a
   Next b
   If ct3 >= 3 Then
     Text1.Text = Text1.Text & n & Str(ways) & Str(ct2) & Str(ct3) & crlf
     For i = 1 To ways
       Text1.Text = Text1.Text & "    " & w(i, 1) & Str(w(i, 2)) & Str(w(i, 3)) & crlf
     Next
   End If
 Next

 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub

  
The test ct3 >= 3  was at first ways >=3, then ct2 >= 3.

  Posted by Charlie on 2016-04-14 09:42:14
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (15)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information