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
Frits 8:33 am on 21 January 2026 Permalink |
# 1111 [base b] is: b^3 + b^2 + b + 1 or (b + 1)(b^2 + 1) # I am not good at modular arithmetic but b^2 + 1 is never a multiple of # numbers 4.k + 3. So b + 1 must be divisible by 3, 7 and 11 and thus by 231. for b1 in range(231, 10001, 231): # calculate n = 1111 [base b] b = b1 - 1 n = b1 * (b**2 + 1) # n must be divisible by numbers 2-16 if any(n % i for i in [9, 11, 13, 14, 15, 16]): continue print("answer:", b)LikeLike
Jim Randell 9:11 am on 21 January 2026 Permalink |
@Frits: A neat bit of analysis. That is probably the kind of approach the setter had in mind.
In fact as (b^2 + 1) is not divisible by 3, then it is also not divisible by 9, so we can proceed in steps of: 9 × 7 × 11 = 693, which only needs 14 iterations.
This Python program has an internal runtime of 34µs:
from enigma import (irange, printf) S = 9 * 7 * 11 R = 720720 // S for i in irange(S, 10000, step=S): b = i - 1 n = i * (b*b + 1) if n % R == 0: printf("base={b} n={n}")LikeLike
Jim Randell 9:40 am on 21 January 2026 Permalink |
In fact although (b^2 + 1) may be divisible by 2, it cannot be divisible by 4, so we can move in steps of:
And, as the base is limited to be less than 10000, there is only one value to check (or if we accept that there is a solution to the puzzle, then there are no values to check).
LikeLike
Frits 1:10 pm on 21 January 2026 Permalink |
@Jim, good work.
if b is even then b=2k and b^2 + 1 = 4k^2 + 1
if b is odd then b = 2k+1 and b^2 + 1 = 4k^2 + 4k + 2
so indeed b^2 + 1 cannot be divisible by 4.
LikeLike