Originally Posted by
Matticus
It seems to rely more on coincidence (or some obscure mathematical rule that I am unaware of) than mathematical logic
Well, the rule is pretty obscure for sure. If we define
Let
N = sum(Ni ⋅ 10i, i = 0..LN-1)
where
1 ≤ Ni ≤ 9, i = LN-1
0 ≤ Ni ≤ 9, 0 ≤ i < LN-1
and
D = sum(Di ⋅ 10i, i = 0..LD-1)
where
1 ≤ Di ≤ 9, i = LD-1
0 ≤ Di ≤ 9, 0 ≤ i < LD-1
so that
N is an
LN-digit positive decimal number,
10LN-1 ≤ N < 10LN
and
D is an
LD-digit positive decimal number,
10LD-1 ≤ D < 10LD
the rule is
There is a pair (
n,
d),
0 ≤ n < LN
0 ≤ d < LD
Nn = Dd
that fulfills the following rule:
U = sum(Ni ⋅ 10i, i = 0..n-1) + sum(Ni ⋅ 10i-1, i = n+1..LN-1)
V = sum(Di ⋅ 10i, i = 0..d-1) + sum(Di ⋅ 10i-1, i = d+1..LD-1)
N V = D U ≠ 0
I don't think there is a simpler way to state the rule (anything like summing the digits, or such tricks); I think this was what Matticus was saying, too.
The OP's problem to be solved is to find all that fulfill the above, when LN = LD = 2. My awk scriptlet says there are 242 of those if you count 89/89 = 8/8 and 89/89 = 9/9 as two separate cases, or 170 if you count 89/89 = 8/8 = 9/9 only once.