Teaser 2363: [A round number]
From The Sunday Times, 6th January 2008 [link]
We are used to thinking of 1,000 as a “round number”, but this is very much based on 10. One definition of a round number is that it should have lots of small factors, and certainly that it should be divisible by every number up to and including sixteen. There is one such round number that, when written in a certain base (of less than 10,000), looks like 1111. What is more, its base can be found very neatly.
What is that base?
This puzzle was originally published with no title.
[teaser2363]
Jim Randell 9:17 am on 20 January 2026 Permalink |
Programatically, it is straightforward to just try all possible bases.
This Python program runs in 75ms. (Internal runtime is 4.2ms).
from enigma import (irange, mlcm, call, nconcat, printf) # M = LCM(2..16) M = call(mlcm, irange(2, 16)) # consider possible bases for b in irange(2, 9999): # n = 1111 [base b] n = nconcat([1, 1, 1, 1], base=b) # check for divisibility by 2..16 if n % M == 0: # output solution printf("base={b} n={n}")But here is a more sophisticated approach:
Another way to write 1111 [base b] is: b^3 + b^2 + b + 1, which is an integer valued polynomial function.
And this means we can use the [[
poly_roots_mod()]] solver from the enigma.py library (described here: [ link ]) to solve the puzzle.The following Python program has an internal runtime of 572µs.
from enigma import (Polynomial, rev, irange, mlcm, call, poly_roots_mod, printf) # calculate 1111 [base b] p = Polynomial(rev([1, 1, 1, 1])) # M = LCM(2..16) M = call(mlcm, irange(2, 16)) # find roots of p(b) = 0 [mod M] that give a valid base roots = poly_roots_mod(p, 0) for b in roots(M): if 1 < b < 10000: # calculate the corresponding n value n = p(b) # output solution printf("base={b} n={n}")Solution: The base is: 5543.
And the round number is: 170338568400 = 720720 × 236345.
LikeLike
Ruud 10:52 am on 20 January 2026 Permalink |
LikeLike