 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Unknown Digits (Posted on 2004-08-11) 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.) Better late than never Comment 9 of 9 | 56505
+ 15105
----------
71610

Instead of calling the sum DBABC, I called it EFGHI and then let E be limited to D +/- 1, F be limited to B +/- 1 etc.

count = 0
for A in range(1,10):
for B in range(0,10):
if A==B:
continue
for C in range(1,10):
if A==C or B==C:
continue
for D in range(0,10):
if A==D or B==D or C==D:
continue
CACBA = 10000*C+1000*A+100*C+10*B+A

for E in range(D-1,D+2,2):
for F in range(B-1,B+2,2):
for G in range(A-1,A+2,2):
for H in range(B-1,B+2,2):
for I in range(C-1,C+2,2):
DBABC = 10000*E + 1000*F+100*G+ 10*H + I
if n == DBABC:
count += 1

print('done', count)
---
Output:
56505 15105 71610 71610
done 1

 Posted by Larry on 2019-11-18 20:32:56 Please log in:

 Search: Search body:
Forums (2)