## Sunday Times Teaser 3112 – PIN

*by Andrew Skidmore*

#### Published Sunday May 15 2022 (link)

Callum has opened a new current account and has been given a telephone PIN that is composed of non-zero digits (fewer than six). He has written down the five possible rearrangements of his PIN. None of these five numbers are prime; they can all be expressed as the product of a certain number of different primes.

The PIN itself is not prime; it can also be expressed as the product of different primes but the number of primes is different in this case. The sum of the digits of his PIN is a square.

What is the PIN?

*by Howard Williams*

#### Published Sunday May 08 2022 (link)

I have an analogue wall clock with a second hand and also a separate 24-hour hh:mm:ss digital clock. The wall clock loses a whole number of seconds over a two-digit period of seconds. The digital clock gains at a rate 2½% greater than the wall clock loses. After resetting both clocks to the correct time, I noticed that they both displayed the same but wrong time later in the same week, and one hour earlier than the time of setting.

I can reset one of the clocks at an exact hour so that it will show the correct time when the televised rugby kicks off at 19:15:00 on the 31st.

What is the latest time (hour and date) when I can do this?

## Sunday Times Teaser 3110 – Many a Slip

**by Victor Bryant**

**by Victor Bryant**

#### Published Sunday May 01 2022 (link)

I have written down three 3-figure numbers in decreasing order and added them up to give their 4-figure sum, which is a perfect square: the digit 0 occurred nowhere in my sum.

Now I have attempted to replace digits consistently by letters and I have written the sum as

**CUP + AND + LIP = SLIP**

However, there’s “many a slip twixt cup and lip” and unfortunately one of those thirteen letters is incorrect. If you knew which letter was incorrect then you should be able to work out the three 3-figure numbers.

What are they?

## Sunday Times Teaser 3109 – Hole Numbers

*by Colin Vout*

#### Published Sunday April 24 2022 (link)

In theoretical golf, you have a set of “clubs” each of which hits a ball an exact number of yards forwards or backwards. You own the following set: 3, 8, 17, 19 and 35. For example, if a hole is 31 yards long, you can reach it in three strokes, with two forward hits of the 17 and a backward hit of the 3. In the next competition, you are only allowed to use three clubs, and the course consists of three holes whose lengths are 101, 151 and 197 yards. In order to get round the course in the fewest possible strokes, you must make a wise choice of clubs.

Which three clubs (in ascending order) should you choose, and what will the individual hole scores be (in order)?

*by Bernardo Recamán*

#### Published Sunday April 17 2022 (link)

When my grandfather died, he left his fine collection of coins, not more than 2500 of them, to his children, a different number to each of them, and in decreasing amounts according to their ages.

To the eldest of his children, he left one fifth of the coins, while the youngest inherited just one eleventh of them. Gaby, my mother, and third oldest of the children, received one tenth of the collection. All the other children received a prime number of coins.

How many coins did my aunt Isabel, second oldest in the family, inherit?

## Sunday Times Teaser 3107 – Room 101

*by Nick MacKinnon*

#### Published Sunday April 10 2022 (link)

In the Ministry of Love, O’Brien told Winston Smith to calculate five-digit perfect squares, none sharing a prime factor with 1984. “And Winston, no two of them may differ by a multiple of 101 or you know what will happen. Now find as many as you can.” When Winston said he had found more than fifty, O’Brien replied, “Well done, Winston. Although there were a quadrillion solutions, I know some of your squares.” “Does the party control my mind?” “We do Winston. Did you choose 10201, for example?” “Of course not! It’s the worst square in the world!” “How many fingers am I holding up Winston?” “Three? Four? I don’t know!” “That’s how many of your squares we know.”

What four squares did O’Brien know?

*by Stephen Hogg*

#### Published Sunday April 03 2022 (link)

An underground car park has rectangular walls, each covered with 300 abutting square tiles arranged in three repeats of red, orange, yellow, green and blue columns twenty tiles high. A sharp tapering shadow from a duct played across one wall from top to bottom (with straight lines similar to that shown).

Each shadow edge crossed every colour and, curiously, hit just two points where four tile corners met. The upper and lower pairs of these were on levels the same distance up and down from the mid-level line. I also noticed that no column was completely free of shadow, but just one column was completely in shadow.

Give the shadow’s area relative to the wall area as a fraction in simplest form.

## Sunday Times Teaser 3105 – Roman Primes

*by Peter Good*

#### Published Sunday March 27 2022 (link)

Romulus played a game using several [1] identical six-sided dice. Each die face shows a different single-character Roman numeral. He rolled two dice and was able to form a prime number in Roman numerals by arranging the two characters. Romulus rolled more dice and, after each roll, formed a prime number with one more character, rearranging the sequence as needed, until he could no longer form a prime number less than 100. He was using standard notation where a character before another that is 5 or 10 times larger is subtracted from the larger one, eg, IX=9.

After playing many games he realised that there were exactly three primes less than 100 that could not occur in any of the sequences.

In decimal notation and in ascending order, what were those prime numbers?

[1] The word ‘several’ here is not intended to impose or imply any limit on the number of available dice.

*by Edmund Marshall*

#### Published Sunday March 20 2022 (link)

There are more than 13 clubs in the Prime Football League, and each club plays each other twice during the football season, gaining three points for winning a match, and one point for a draw.

At the end of last season, it was observed that the final numbers of points gained by the clubs were all different double-digit prime numbers. During the season our local club, Wessex Wanderers, won just three times as many matches as they lost. If you knew how many clubs were in the league, you could work out the final points total of Wessex Wanderers.

How many clubs are in the league, and what was the final points total of Wessex Wanderers?

## The Archimedes Cattle Problem

The Archimedes Cattle Problem is a well known mathematical problem attributed to Archimedes. The problem, which is described both here and here, is interesting because it suggests a remarkable early insight into mathematics that was only fully developed many centuries later in the middle ages. In particular, it suggests that, while those who posed the problem could not give a solution, they were confident enough in the mathematics involved to know that a solution did exist. The problem, the history involved its solution and methods for it solution are reviewed in this paper by H.W. Lenstra Jr.

I thought it would be interesting to produce a solution in Python.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
from fractions import Fraction as RF from functools import reduce from operator import mul from math import lcm from number_theory import factor, Qde # print full output if full = True full = False # Crout LU decomposition (which uses an implied unit # diagonal for the upper triangular matrix) # # S = source matrix, D = destination matrix # # if D is present return the LU decomposition with # S unchanged; otherwise the LU decomposition will # be computed in place and returned in S def crout(S, D=None): if D is None: D = S n = len(S) for k in range(n): for r in range(k, n): D[r][k] = S[r][k] - sum(D[r][j] * D[j][k] for j in range(k)) t = RF(1, D[k][k]) for c in range(k + 1, n): D[k][c] = t * (S[k][c] - sum(D[k][j] * D[j][c] for j in range(k))) # Solve the system L.U.x = v for the vector (v) def solve_crout(LU, v): n = len(LU) x = [0] * n for i in range(n): t = RF(1, LU[i][i]) x[i] = t * (v[i] - sum(LU[i][j] * x[j] for j in range(i))) for i in reversed(range(n)): x[i] -= sum(LU[i][j] * x[j] for j in range(i + 1, n)) return x # the fractions in the Archimedes Cattle Problem nd = ((5, 6), (9, 20), (13, 42), (7, 12), (9, 20), (11, 30)) f1, f2, f3, f4, f5, f6 = (RF(n, d) for n, d in nd) # First step: establish the equations set out on Wikipedia at: # https://en.wikipedia.org/wiki/Archimedes%27s_cattle_problem # W B D Y w b d y M = [ [ -1, f1, 0, 1, 0, 0, 0, 0 ], [ 0, -1, f2, 1, 0, 0, 0, 0 ], [ f3, 0, -1, 1, 0, 0, 0, 0 ], [ 0, f4, 0, 0, -1, f4, 0 , 0 ], [ 0, 0, f5, 0, 0, -1, f5, 0 ], [ 0, 0, 0, f6, 0, 0, -1, f6 ], [ f3, 0, 0, 0, f3, 0, 0, -1 ], [ 1, 1, 1, 1, 1, 1, 1, 1 ] ] # the right hand side R = [ 0, 0, 0, 0, 0, 0, 0, 1 ] # solve and scale the results to give integer values crout(M) S = solve_crout(M, R) d = lcm(*(x.denominator for x in S)) S = tuple(int(x * d) .denominator for x in S) if full: for n, s in zip('WBDYwbdy', S): print(f"{n} = {s:>10_} * k") print() # Part 2(1): B + W is a perfect square. All solutions are # multiples (k) of the above integer values for (B, W, ...) # and k must now be chosen such that k.(B + W) is a perfect # square. To ensure this, k itself must be the product of the # square free factors of B + W multiplied by any square (q) k_sqfp = reduce(mul, (f for f, x in factor(S[0] + S[1]) if x & 1)) # Part 2(2): k.(D + Y) is a triangular number t.(t + 1) / 2 # where k is derived above as k_sqfp.q^2, hence giving: # # (2t + 1)^2 - 8.(D + Y).bw_sqfp.q^2 = 1 # # This is a quadratic diophantine equation r^2 - C.q^2 = 1 with # C = 8.(D + Y).bw_sqfp; now use Amthor's strategy by expressing # C as a product of square and square-free components (with the # former as a square root) fctrs = factor(8 * (S[2] + S[3]) * k_sqfp) sqfc = reduce(mul, (f for f, x in fctrs if x & 1)) srtc = reduce(mul, (f ** t for f, x in fctrs if (t:= x // 2))) # we now have to solve the quadratic diophantine equation # r^2 - sqfc.(srtc.s)^2 where the second component of the # solution is a multiple of srtc p = Qde(sqfc, 1) for r, sm in p.solve(): # sm must be a multiple of srtc m, rem = divmod(sm, srtc) if m and not rem: # k = k_sqfp.m^2 - now compute the number of cattle in each # category and the overall total (only output the first and # last 20 digits) if full: for n, s in zip('WBDYwbdy', S): c = str(s * k_sqfp * m ** 2) print(f"{n} = {c[:20]} ..{len(c) - 40:}.. {c[-20:]}") c = str(sum(S) * k_sqfp * m ** 2) print(f"T = {c[:20]} ..{len(c) - 40}.. {c[-20:]}") break |