One of the most famous mathematical puzzles – it's more than a hundred years old – can be solved using SAP S/4HANA for advanced variant configuration (AVC).
We're discussing the "SEND + MORE = MONEY" puzzle, which falls under the category of verbal arithmetic, also known as alphametics, cryptarithms, or word addition (see Wikipedia for details).
The invention of this brainteaser is attributed to the English author and mathematician Henry Dudeney, who published it in "The Strand Magazine" in July 1924. Rumor has it that a student once used this calculation in a letter to his father to request financial support.
What you see here is a plain-vanilla addition, with the slight difference that the figures are letters. Different letters represent different figures in the way that two different letters never stand for the same digit. Leading zeros are not allowed.
But how can AVC help us in this regard? We'll use a configuration model with a constraint, and we'll try to figure out which restrictions are necessary to solve the problem with minimal effort. To this end, we'll conduct three experiments with different RESTRICTION parts in the constraint.
But first, let's see what we can find out with a bit of mental work:
Altogether, we get four different sets of restrictions :
We can solve this puzzle with further logical considerations and by checking the remaining combinations. But let's see how much AVC can determine using only parts of these restrictions.
Before conducting the three experiments, we need to build a model.
These are the preliminary steps to make this puzzle available in the simulation environment:
OBJECTS:
X IS_A (300)CL_SEND_MORE_MONEY.The music is now within the restriction of the constraint (for details on the restriction, refer to the documentation here). Technically, we've got only one restriction, but we can combine several 'sub-restrictions' using the keyword AND, or a comma.
In our first experiment, we want to do without restriction C because this is the most cumbersome to write down. Using the others, our RESTRICTION part could look like this:
RESTRICTION:
* No. 1: The summation itself
(X.SEND = X.S*1000 + X.E*100 + X.N*10 + X.D)
AND
(X.MORE = X.M*1000 + X.O*100 + X.R*10 + X.E)
AND
(X.MONEY = X.M*10000 + X.O*1000 + X.N*100 + X.E*10 + X.Y)
AND
(X.SEND + X.MORE = X.MONEY),
* No. 2: All values must be unique.
(NOT (X.S = X.E) AND NOT (X.S = X.N) AND NOT (X.S = X.D) AND NOT (X.S =
X.M) AND NOT (X.S = X.O) AND NOT (X.S = X.R) AND NOT (X.S = X.Y))
AND
(NOT (X.E = X.N) AND NOT (X.E = X.D) AND NOT (X.E = X.M) AND NOT (X.E =
X.O) AND NOT (X.E = X.R) AND NOT (X.E = X.Y))
AND
(NOT (X.N = X.D) AND NOT (X.N = X.M) AND NOT (X.N = X.O) AND NOT (X.N =
X.R) AND NOT (X.N = X.Y))
AND
(NOT (X.D = X.M) AND NOT (X.D = X.O) AND NOT (X.D = X.R) AND NOT (X.D =
X.Y))
AND
(NOT (X.M = X.O) AND NOT (X.M = X.R) AND NOT (X.M = X.Y))
AND
(NOT (X.O = X.R) AND NOT (X.O = X.Y))
AND NOT (X.R = X.Y),
* No. 3: The value restrictions found by reasoning
(X.M = 1)
AND
(X.O = 0)
AND
(X.S = 9).
The second restriction may appear somewhat complicated at first glance. But note that we can't use syntax elements like FOR loops in the editor coding.
To ease our work with this second (sub-)restriction, we can use an LLM (large language model) and enter the following prompt:
# List:
X.S, X.E, X.N, X.D, X.M, X.O, X.R, X.Y
---
Build a list of all pairs from this list, disregarding the order of the elements. Mathematically, the number of these pairs is "8 choose 2". Connect all pairs using this syntax: NOT (X.S = X.E) AND NOT (X.S = X.N) AND NOT... This means you should create an uninterrupted string of all possible inequalities connected by the keyword "AND".
When the model is ready and in status "Released", let's push the Test button and see what happens in the simulation:
When we try different values for E, all values but 5 will result in an inconsistency:
With E = 5, we get:
This leaves us with three possible values for R: 3, 4, and 8 (keeping in mind the uniqueness restriction B). But we can tell from the value MORE = 1085 (the value is greyed out, leaving no alternative!) that only 8 works fine, so we've solved our puzzle:
(Note that, if you enter E = 5 right away or after reloading the configuration model, also the value for R = 8 is greyed out immediately.)
Let's try a different approach!
In our second experiment, we drop D (values for M, S, and O) and use the following RESTRICTION (with No. 1 to 3 corresponding to A, B, and C from above):
RESTRICTION:
* No. 1: The summation itself
(X.SEND = X.S*1000 + X.E*100 + X.N*10 + X.D)
AND
(X.MORE = X.M*1000 + X.O*100 + X.R*10 + X.E)
AND
(X.MONEY = X.M*10000 + X.O*1000 + X.N*100 + X.E*10 + X.Y)
AND
(X.SEND + X.MORE = X.MONEY),
* No. 2: All values must be unique.
(NOT (X.S = X.E) AND NOT (X.S = X.N) AND NOT (X.S = X.D) AND NOT (X.S =
X.M) AND NOT (X.S = X.O) AND NOT (X.S = X.R) AND NOT (X.S = X.Y))
AND
(NOT (X.E = X.N) AND NOT (X.E = X.D) AND NOT (X.E = X.M) AND NOT (X.E =
X.O) AND NOT (X.E = X.R) AND NOT (X.E = X.Y))
AND
(NOT (X.N = X.D) AND NOT (X.N = X.M) AND NOT (X.N = X.O) AND NOT (X.N =
X.R) AND NOT (X.N = X.Y))
AND
(NOT (X.D = X.M) AND NOT (X.D = X.O) AND NOT (X.D = X.R) AND NOT (X.D =
X.Y))
AND
(NOT (X.M = X.O) AND NOT (X.M = X.R) AND NOT (X.M = X.Y))
AND
(NOT (X.O = X.R) AND NOT (X.O = X.Y))
AND NOT (X.R = X.Y),
* No. 3: The carryover restrictions
((X.D + X.E = X.Y) OR (X.D + X.E = X.Y + 10))
AND
((X.N + X.R = X.E) OR (X.N + X.R + 1 = X.E) OR (X.N + X.R = X.E + 10)
OR
(X.N + X.R + 1 = X.E + 10))
AND
((X.E + X.O = X.N) OR (X.E + X.O + 1 = X.N) OR (X.E + X.O = X.E + 10)
OR
(X.E + X.O + 1 = X.E + 10))
AND
((X.S + X.M = X.O + 10) OR (X.S + X.M + 1 = X.O + 10)).We have a little more work to do now, trying out values (starting with S and then E), but in the end, the result is the same.
However, the winner in terms of saving human thinking energy is the next one: It uses only A) and B), and the relatively simple conclusion from D that M must be 1.
The last experiment is the best in terms of its restrictions' efficiency, and this is its RESTRICTION part:
RESTRICTION:
* No. 1: The summation itself
(X.SEND = X.S*1000 + X.E*100 + X.N*10 + X.D)
AND
(X.MORE = X.M*1000 + X.O*100 + X.R*10 + X.E)
AND
(X.MONEY = X.M*10000 + X.O*1000 + X.N*100 + X.E*10 + X.Y)
AND
(X.SEND + X.MORE = X.MONEY),
* No. 2: All values must be unique.
(NOT (X.S = X.E) AND NOT (X.S = X.N) AND NOT (X.S = X.D) AND NOT (X.S =
X.M) AND NOT (X.S = X.O) AND NOT (X.S = X.R) AND NOT (X.S = X.Y))
AND
(NOT (X.E = X.N) AND NOT (X.E = X.D) AND NOT (X.E = X.M) AND NOT (X.E =
X.O) AND NOT (X.E = X.R) AND NOT (X.E = X.Y))
AND
(NOT (X.N = X.D) AND NOT (X.N = X.M) AND NOT (X.N = X.O) AND NOT (X.N =
X.R) AND NOT (X.N = X.Y))
AND
(NOT (X.D = X.M) AND NOT (X.D = X.O) AND NOT (X.D = X.R) AND NOT (X.D =
X.Y))
AND
(NOT (X.M = X.O) AND NOT (X.M = X.R) AND NOT (X.M = X.Y))
AND
(NOT (X.O = X.R) AND NOT (X.O = X.Y))
AND NOT (X.R = X.Y),
* No. 3: The value for M
(X.M = 1).This appears to be very similar to our first experiment, except that the values for S and O are missing.
The only work to do with this example is to write down No. 1 (a no-brainer), have No. 2 generated by AI, and think a bit to get X.M = 1 (no leading zeros!). After this, you see that the values for S, M, and O have been fixed in the simulation, and you just need to figure out what E has to be.
The effort is just the same as with the first experiment: AVC takes over the brainwork to get the values of S and O.
And we already know that E = 5 does the trick:
That's it! In case you're reading this right after publishing, have a great end of the year 2025, and an even better start into 2026!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 20 | |
| 13 | |
| 13 | |
| 12 | |
| 11 | |
| 10 | |
| 10 | |
| 10 | |
| 9 | |
| 9 |