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

Home > Numbers
5-Digit Squares (Posted on 2009-12-06) Difficulty: 3 of 5

No Solution Yet Submitted by brianjn    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 5
Well, somehow I managed to remember the site after 2 years of inactivity, and decided to start wasting some homework time here, again.

First off, I decided to find the maximum value of A by determining when A+(A+1) was as close to 100,000 as possible without going over. That gets us a range of A's to check from 100 to 223.

We check B over the range A+1 to √(100000-A).

To check all possible values for A, B, and C, I used the following code in Python.

def five_digit_squares():
    for val_a in range(100,224):
        for val_b in range(val_a+1,int((100000-val_a**2)**.5)):
            if val_c**2==(val_a**2+val_b**2) and val_c<=316:
                if works==1:
                    for digit in range(0,15):
                        if used.count(str_digits[digit])==0:
                    if works==11:

This ends up getting us a solution of 136 273 305. So, A is 136, B is 273, and C is 305.

136=1 8 4 9 6
273=7 4 5 2 9
305=9 3 0 2 5

Edited on December 6, 2009, 9:39 pm
  Posted by Justin on 2009-12-06 21:34:31

Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information