Sunday Times Teaser 2981 – Faulty Pedometer
by Howard Williams
Published November 10 2019 (link)
Judith is a keen walker who uses a fivedigit pedometer to record her number of steps. Her pedometer is inaccurate as some of the counters consistently move on to 0 early by missing out one or more digits. For instance, one of them might roll over from 7 to 0 every time instead of from 7 to 8, missing out digits 8 and 9. She is, however, well aware of this and can work out the correct number of steps.
After walking her usual distance, the pedometer shows 37225 steps but she knows that the true number is 32% less than this. A second distance she walks requires a 30% reduction in the number displayed to give the true number of steps.
How many steps is the second distance?

Erling Torkildsen permalink1234567891011121314151617181920212223# It can be shown that if the real number of steps is s, then a pedometer# with bases 10, a, b, c, d for digit places left to right will display:## p(s) = s + (10  d) * (s // D) + 10 * (10  c) * (s // C)# + 100 * (10  b) * (s // B) + 1000 * (10  a) * (s // A)## where A, B, C and D are the 'placevalues' created by the bases.for a in range(6, 11):for b in range(6, 11):for c in range(6, 11):for d in range(6, 11):A, B, C, D, s = d * c * b * a, d * c * b, b * c, d, 25313p = (s + (10  d) * (s // D) + 10 * (10  c) * (s // C)+ 100 * (10  b) * (s // B) + 1000 * (10  a) * (s//A))if p == 37225:for s in range(10000, 100000):p = (s + (10  d) * (s // D) + 10 * (10  c) * (s // C)+ 100 * (10  b) * (s // B) + 1000 * (10  a) * (s//A))if 10 * s == 7 * p:print(f"The second distance is {int(s)} steps.")