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

Home > Numbers
Unknown Digits (Posted on 2004-08-11) Difficulty: 4 of 5
In this cryptarithm, each letter above the line represents a digit differing by 1 from the digit represented by the same letter below the line. For example, if A=3 above the line, then A=2 or A=4 below the line. All occurrences of a letter on the same side of a line represent the same digit. It is also known that there are total of five digits in the solution.
 ADABA
+CACBA
------
 DBABC

See The Solution Submitted by Brian Smith    
Rating: 3.6667 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution brute force -- spoiler | Comment 1 of 10

FOR a = 1 TO 9
FOR b = 0 TO 9
IF b <> a THEN
FOR c = 1 TO 9
IF c <> a AND c <> b THEN
FOR d = 0 TO 9
IF d <> c AND d <> b AND d <> a THEN

  top = a * 10101 + d * 1000 + b * 10
  bottom = c * 10100 + a * 1001 + b * 10
  tot = top + bottom
  t$ = LTRIM$(STR$(tot))
  IF LEN(t$) = 5 THEN
    IF MID$(t$, 2, 1) = MID$(t$, 4, 1) THEN
      IF ABS(VAL(MID$(t$, 3, 1)) - a) = 1 THEN
      IF ABS(VAL(MID$(t$, 2, 1)) - b) = 1 THEN
      IF ABS(VAL(MID$(t$, 5, 1)) - c) = 1 THEN
      IF ABS(VAL(MID$(t$, 1, 1)) - d) = 1 THEN
       PRINT top: PRINT bottom: PRINT tot
      END IF
      END IF
      END IF
      END IF
    END IF
  END IF


END IF
NEXT d
END IF
NEXT c
END IF
NEXT b
NEXT a

finds

56505
15105

71610

 


  Posted by Charlie on 2004-08-11 13:24:39
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