# Enigmatic Code

Programming Enigma Puzzles

## Enigma 1145: More or less

From New Scientist #2301, 28th July 2001

With the usual letters-for-digits understanding, here are two recurring decimals in word form:

·MOREMOREMORE…
·LESSLESSLESS…

One is a multiple of the other and one when written as a fraction in its simplest form, has a denominator of less than a thousand.

What is that simplest fraction?

[enigma1145]

Advertisements

### 3 responses to “Enigma 1145: More or less”

1. Jim Randell 17 October 2016 at 8:13 am

I used the generalised Alphametic solver – SubstitutedExpression() – in the enigma.py library to generate possible values for MORE and LESS, and then deal with the fractions in Python. This gives a compact program that runs in 287ms.

```from fractions import Fraction as F
from enigma import SubstitutedExpression, printf

# find solutions for MORE and LESS where one divides the other
p = SubstitutedExpression("max(MORE, LESS) % min(MORE, LESS) = 0", d2i={})
for s in p.solve():
(MORE, LESS) = (int(p.substitute(s, x)) for x in ('MORE', 'LESS'))
# consider their values as fractions
(more, less) = (F(x, 9999) for x in (MORE, LESS))
# one of the denominators is less than a thousand
if more.denominator > 999 and less.denominator > 999: continue
# output the solution
printf(".(MORE) = .({MORE:04d}) = {more}, .(LESS) = .({LESS:04d}) = {less}")
```

Solution: The fraction is 59/101.

The actual decimal fractions are:

0.(MORE) = 0.(5841) = 59/101
0.(LESS) = 0.(0177) = 59/3333
MORE = 33 × LESS

2. Hugh Casement 18 October 2016 at 4:55 pm

101 is the smallest prime denominator (and probably the smallest integer denominator at all) that gives repeating decimal fractions of period 4.  See OEIS no. A051626 and A007138.

3. Tessa Fullwood 26 October 2016 at 3:14 pm

Any simplifying of the denominator by division must be a factor of 9999, so 3, 9, 11, 101. LESS cannot have 11, or 101 as a factor by applying the remainder theorem; a factor of 11 means L-E+S-S is a multiple of 11, for 101 LE – SS is a multiple of 101. From the simplification of the denominator MORE must have either 11, or 101 as a factor. And the multiple by which to multiply LESS to obtain MORE must also have a factor 11 or 101.