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

 Four Elements (Posted on 2013-02-14)
At one period the Ancients recognised four elements:
```                Fire
Air    Earth
Water```
Solve the following base10 alphametric when the elements are in balance according to:
FIRE + EARTH = AIR + WATER,
and AIR wholly divides FIRE.

Note that by ignoring "AIR wholly divides FIRE" there are three other solutions to the alphametric.

Analytical solutions (PnP) can be reasonably achieved.

 See The Solution Submitted by brianjn No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 In the absence of a PnP solution (spoiler). Comment 1 of 1

DECLARE SUB permute (a\$)
CLS
s\$ = "1234567890": hld\$ = s\$
DO
f\$ = MID\$(s\$, 1, 1)
i\$ = MID\$(s\$, 2, 1)
r\$ = MID\$(s\$, 3, 1)
e\$ = MID\$(s\$, 4, 1)
a\$ = MID\$(s\$, 5, 1)
t\$ = MID\$(s\$, 6, 1)
h\$ = MID\$(s\$, 7, 1)
w\$ = MID\$(s\$, 8, 1)

fire = VAL(f\$ + i\$ + r\$ + e\$)
air = VAL(a\$ + i\$ + r\$)
earth = VAL(e\$ + a\$ + r\$ + t\$ + h\$)
water = VAL(w\$ + a\$ + t\$ + e\$ + r\$)
IF fire + earth = air + water THEN
IF MID\$(s\$, 9, 1) > MID\$(s\$, 10, 1) THEN
PRINT fire; earth, air; water;
IF fire MOD air = 0 THEN PRINT "*":  ELSE PRINT
END IF
END IF

permute s\$
LOOP UNTIL s\$ = hld\$

finds

FIRE  EARTH   AIR  WATER
9384  41802   138  51048 *
9485  50821   048  60258
9573  30721   057  40237
9681  14805   468  24018
9684  41832   168  51348
9846  61402   184  71064
9870  03724   387  13207
9873  30751   087  40537

(The leading zeros were inserted manually on the small numbers.)

The real solution is marked with an asterisk. Among the others, some have leading zeros, in either earth or air, as can be seen. As the puzzle states, there are only three alternate alphametic solutions that avoid leading zeros.

 Posted by Charlie on 2013-02-15 14:33:37

 Search: Search body:
Forums (0)