Enigmatic Code

Programming Enigma Puzzles

Enigma 1459: Twelve elevenths

From New Scientist #2620, 8th September 2007

If we assume that 11 metres = 12 yards, what is the smallest integral number of metres that can be converted to its equivalent integral number of yards simply by rearranging the order of the digits of the number?

[enigma1459]

3 responses to “Enigma 1459: Twelve elevenths”

1. Jim Randell 24 February 2013 at 10:24 am

This is a simple puzzle to solve programatically. The following Python code runs in 36ms. It assumes that the number of metres is a positive integer.

```from itertools import count
from enigma import printf

for n in count(1):
(m, y) = (11 * n, 12 * n)
if sorted(str(m)) == sorted(str(y)):
printf("{m} metres = {y} yards")
break
```

Solution: 1683 metres = 1836 yards.

2. Naim Uygun 24 February 2013 at 11:13 am
```for meters in range(11,2000,11):
yards=12*(meters//11)
sm=sorted(list(str(meters)))
sy=sorted(list(str(yards)))
if sm==sy:
print(meters,yards)
break
```
3. Hugh Casement 6 December 2014 at 4:02 pm

A further solution would be 5724 yards = 5247 m. There are many more if we go to larger numbers.

But I have to say it’s a lousy conversion factor. 35 yards = 32 m would be a much closer rule-of-thumb approximation. I haven’t found any “anagram” conversions using four digits or fewer.

This site uses Akismet to reduce spam. Learn how your comment data is processed.