Browse · MATH
Printjmc
prealgebra senior
Problem
I am playing a walking game with myself. On move 1, I do nothing, but on move where , I take one step forward if is prime and two steps backwards if the number is composite. After all 25 moves, I stop and walk back to my original starting point. How many steps long is my walk back?
Solution
We begin by counting how many prime and composite numbers there are between 2 and 25 inclusive. The prime numbers in that range are 2, 3, 5, 7, 11, 13, 17, 19, 23, so there are 9 prime numbers. This means that there are composite numbers.
For each of the 9 prime numbers, I take one step forward, and for each of the 15 composite numbers, I take two steps back, for a net total of steps forward, i.e., 21 steps backwards. Hence after 25 moves, I am 21 steps away from my original starting point, so my walk back is steps long.
For each of the 9 prime numbers, I take one step forward, and for each of the 15 composite numbers, I take two steps back, for a net total of steps forward, i.e., 21 steps backwards. Hence after 25 moves, I am 21 steps away from my original starting point, so my walk back is steps long.
Final answer
21