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

Home > Numbers
five, four and tri (Posted on 2009-04-18) Difficulty: 2 of 5
Solve this alphametic, where each of the small letters in bold represents a different decimal digit from 0 to 9. None of the numbers can contain any leading zero.

(five)2 = (four)2 + (tri)2

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: Alphametric computer soltuion | Comment 3 of 4 |
(In reply to Alphametric computer soltuion by Brian Smith)

Indeed:

DEFDBL A-Z
FOR f = 1 TO 9
 used(f) = 1
FOR t = 1 TO 9
IF used(t) = 0 THEN
 used(t) = 1
FOR i = 0 TO 9
IF used(i) = 0 THEN
 used(i) = 1
FOR v = 0 TO 9
IF used(v) = 0 THEN
 used(v) = 1
FOR e = 0 TO 9
IF used(e) = 0 THEN
 used(e) = 1
 five = f * 1000 + i * 100 + v * 10 + e
FOR o = 0 TO 9
IF used(o) = 0 THEN
 used(o) = 1
FOR u = 0 TO 9
IF used(u) = 0 THEN
 used(u) = 1
FOR r = 0 TO 9
IF used(r) = 0 THEN
 used(r) = 1
 four = f * 1000 + o * 100 + u * 10 + r
 tri = t * 100 + r * 10 + i
 IF five * five = four * four + tri * tri THEN
   PRINT five; four; tri
 END IF
 used(r) = 0
END IF
NEXT
 used(u) = 0
END IF
NEXT
 used(o) = 0
END IF
NEXT
 used(e) = 0
END IF
NEXT
 used(v) = 0
END IF
NEXT
 used(i) = 0
END IF
NEXT
 used(t) = 0
END IF
NEXT
 used(f) = 0
NEXT

produces

 1496  1320  704

only.


  Posted by Charlie on 2009-04-18 17:27:21
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 (3)
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