If a penny is turned over an even number of times it will end up heads.
If a penny is turned over an odd number of times it will end up tails.
The nth penny will be turned over as many times as n has factors.
The factors of 24 are these eight: 1,2,3,4,6,8,12, and 24. So penny number 24
will be turned over by persons number 1,2,3,4,6,8,12, and 24. It will be
turned over 8 times, and since 8 is even, penny number 24 will end up heads.
If you list the factors of 24, you get (1,24), (2,12), (3,8), (4,6). Two things
to notice here are:
1. Since the factors are listed in pairs, there are an even number of them.
2. The first number of each pair starts at 1 and gets closer and closer to the
square root, while the second number of each pair starts at n (24) and also
gets closer and closer to the square root.
Every number that is not a perfect square follows the pattern above. But what
if the number is a perfect square?
If you list the factors of 36, you get {1,36}, {2,18}, {3,12}, {4,9}, and
{6,6}. The last pair of factors is not really a pair of factors but is just
the square root of 36 listed twice.
Since 6 only counts once as a factor of 36, so 36 has nine factors, an odd
number.
Similarly, every perfect square has some even number of factors (in pairs),
plus its square root as one more factor. Thus, every perfect square has an odd
number of factors. And, it turns out we can go one step further and say that
ONLY perfect squares have an odd number of factors.
Therefore the ONLY pennies that will end up tails are the pennies whose
numbers are perfect squares. Therefore pennies numbered 1²,2²,3²,4²,5²,...
are the only numbers that will end up tails. The square root of 800 is
approximately 28.28427125..., so the largest perfect square that does not
exceed 800 is 28². So the only pennies that will end up heads are the 28
pennies whose numbers are perfect squares.
Edwin