21.5k views
0 votes
I am playing a walking game with myself. On move 1, I do nothing, but on move n where 2 \le n \le 25, I take one step forward if n 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?

User Inverce
by
3.8k points

1 Answer

4 votes

Answer:

21 steps

Explanation:

There are 9 prime numbers and 15 composite numbers between 2 and 25. So, a prime number would be 1 step forward, and a composite number would be 2 steps back.


1*9+(-2)*15=9-30=-21

We then take the absolute value of -21 to get 21 as our answer.

Hope this helped! :)

User Hardik Ranpariya
by
4.1k points