Sunday Times Teaser 2525
by DJT Hogg
Published: 13 February 2011 (link)
“Sandwich numbers” are those of the form BFB, where B is the bread and is a single digit, and F is the filling of any length: BFB has to be divisible by F. For example, 11371 is a sandwich with filling 137 since 11371 = 83 x 137. Incidentally, all of 21372, 31373, … , 91379 are also sandwich numbers, and these nine are said to make up a “sandwich box”.
The filling in my sandwich box today is the smallest beginning with a 3.
What is my filling?
One Comment
Leave one →
-
Brian Gladman permalink12345678910111213# Let the Sandwich number have N + 1 digits: 10^N + 10.F + 1, which,# when divided by F, gives (10^N + 1) / F + 10. Hence F is a divisor# of (10^N + 1). Since 10^(N - 1) <= 10.F < 10^N the limits on F are# 10^(N - 2) <= F < 10^(N - 1).for N in range(2, 20):pwr = 10 ** (N - 2)for d in range(10, 100):F, r = divmod(100 * pwr + 1, d)if not r and F // pwr == 3:print(N, F)