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

 Square = Square + Square (Posted on 2008-08-26)
Determine all 6 digit perfect squares such that the first three digits form a perfect square as do the last three.

The square formed by the first three digits may not have leading zeroes.

 See The Solution Submitted by brianjn Rating: 1.5000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution - brute force | Comment 2 of 6 |
(In reply to Solution - brute force by andre)

Yes, I get these five also:

DEFDBL A-Z
minb = -INT(-SQR(100000))
maxb = INT(SQR(999999))
PRINT minb; maxb, minb * minb; maxb * maxb

FOR b = minb TO maxb
n1 = VAL(LEFT\$(LTRIM\$(STR\$(b * b)), 3))
n2 = VAL(RIGHT\$(LTRIM\$(STR\$(b * b)), 3))
sr = INT(SQR(n1) + .5)
IF sr * sr = n1 THEN
sr = INT(SQR(n2) + .5)
IF sr * sr = n2 THEN
PRINT b, b * b
END IF
END IF
NEXT

` b              b^2380           144400475           225625506           256036570           324900759           576081`

Edited on August 26, 2008, 12:14 pm
 Posted by Charlie on 2008-08-26 11:50:39

 Search: Search body:
Forums (0)