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

Home > Numbers
Square challenge (Posted on 2004-01-20) Difficulty: 2 of 5
Find the smallest number that can be expressed as the sum of two (nonzero) perfect squares in two different ways.
_____________

And what if the two perfect squares must be nonzero, positive, and different?

See The Solution Submitted by SilverKnight    
Rating: 3.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: solution and bonus answer Comment 16 of 16 |
(In reply to solution and bonus answer by Dej Mar)

Actually:

The smallest number that can be expressed as the sum of two (non-zero) perfect squares in three different ways is
325:  12 + 182, 62 + 172 and 102 + 152.

50            1  49         25  25
65            1  64         16  49
85            4  81         36  49
125           4  121        25  100
130           9  121        49  81
145           1  144        64  81
170           1  169        49  121
185           16  169       64  121
200           4  196        100  100
205           9  196        36  169
221           25  196       100  121
250           25  225       81  169
260           4  256        64  196
265           9  256        121  144
290           1  289        121  169
305           16  289       49  256
325           1  324        36  289       100  225
338           49  289       169  169
340           16  324       144  196
365           4  361        169  196
370           9  361        81  289
377           16  361       121  256
410           49  361       121  289
425           25  400       64  361       169  256
442           1  441        81  361
445           4  441        121  324
450           9  441        225  225
481           81  400       225  256
485           1  484        196  289
493           9  484        169  324
500           16  484       100  400
FOR n = 1 TO 500
 ways = 0
 FOR i = 1 TO SQR(n / 2) + 1
  part1 = i * i
  part2 = n - part1
  IF part2 >= part1 THEN
    sr = INT(SQR(part2) + .5)
    IF sr * sr = part2 THEN
      ways = ways + 1
      hold1(ways) = part1
      hold2(ways) = part2
    END IF
  END IF
 NEXT
 IF ways > 1 THEN
  PRINT n,
  FOR i = 1 TO ways
   PRINT hold1(i); hold2(i),
  NEXT
  PRINT
 END IF
NEXT

  Posted by Charlie on 2009-01-26 18:12:02
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
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