Sunday Times Teaser 2542 – Two Routes
by Graham Smithers
Published: 12 June 2011 (link)
A line of equally spaced poles is marked in order with odd numbers, 1, 3, 5, etc. Directly opposite is a parallel line of an equal number of poles with even numbers, 2, 4, 6, etc. There are fewer than 100 poles. The distance in metres between adjacent poles is a two-digit prime; the distance between opposite poles is another two-digit prime. Jan walks the route 1-2-4-3-5, etc to reach the final pole. John walks the odds 1-3-5, etc to the last odd-numbered pole; then walks diagonally to pole 2; then walks the evens 2-4-6, etc, also finishing at the final pole. Jan’s and John’s routes are of equal length.
How many poles are there?
One Comment
Leave one →
-
Brian Gladman permalink1234567891011121314151617181920212223242526272829303132# Let the number of poles be 2.N (since the routes end on the# even poles there must be an even number. The layout is:## p# 1 3___5 ___2.n-1 2.n-1# | | | | |# q | | | ... | OR ... |# |___| |___ | ___|# 2 4 6 2.n 2.n## We have:## N.q + (N - 1).p == 2.(N - 1).p + sqrt((N - 1)^2.p^2 + q^2)## [N.q - (N - 1).p]^2 = (N - 1)^2.p^2 + q^2## (N^2 - 1).q^2 - 2.N.(N - 1).p.q = 0## (N - 1).q.[(N + 1).q - 2.N.p]## which gives (N + 1).q = 2.N.p and hence N = q / (2.p - q),# which means that 2.p - q = 1 and the number of poles is 2.q# so we are looking for a two digit prime 20 < q < 50 such that# (q + 1) / 2 is also primefrom number_theory import Primes, is_primefor q in Primes().range(20, 50):if is_prime((q + 1) // 2):print('There are {} poles.'.format(2 * q))