# A prime time traveler

It is the year 2140 and you have just turned 40. After years of research, you have finally invented the time machine! It is a small device that fits in your pocket and allows you to travel in time. You can travel backwards or forwards in time to any given year, but once you traveled you must wait at least one year before traveling again (the device needs to recharge). You can also take any number of people who are in the same room with you.

You want to use the time machine to meet versions of yourself at a different age. The following conditions apply:

• Once you enter time travel, a version of yourself is created who continues to live in the timeline that you left.
• Time travel is instantaneous, so you don't age while traveling.
• You and your versions will all live to 100 years.
• You can wait in any timeline as many years as you want (until your death).

What is the most number of versions of yourself you can gather in one room where everyone has a different age and they are all prime numbers?

• I interpret "You don't age while you time travel" to mean that time travel is instantaneous. You do age during that year while you wait for the device to recharge. Is that what you meant? Commented Feb 24, 2022 at 14:33
• yes that's correct. Commented Feb 24, 2022 at 14:33
• Cool idea of a puzzle! Any specific reason why you picked prime instead of "the max number of different-age versions of you in one room"? Commented Feb 25, 2022 at 6:13
• @justhalf I just like primes and I thought they would make the puzzle a little harder. Commented Feb 25, 2022 at 6:27
• And it does, and makes better title too! Commented Feb 25, 2022 at 6:30

There are 25 primes below 100:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

So the question is whether we can gather 24 variants plus yourself in one room with all these ages.

Here is one method for doing so.
Exclude $$67$$ from the list of primes, and call the remaining $$24$$ primes $$p_0$$ to $$p_{23}$$ (so $$p_0=2$$, $$p_{23}=97$$).
You could do $$24$$ pickups with exactly one year between pickups, which takes a period of $$23$$ years. After the $$n$$-th year (where $$n$$ ranges from $$0$$ to $$23$$) you can pick up a version with age $$p_{23-n}-(23-n)$$.
After the $$24$$th pickup, the variants you picked up will have aged to become $$p_0$$ to $$p_{23}$$ years old.
You will have aged by $$23$$ years during these actions, but you want to be $$67$$ at the end of it to fill out the complete set of primes, so you should wait $$4$$ years before doing your first pickup of the variant with age $$p_{23}-23=74$$.

Note that $$p_{23-n}-(23-n)$$ is always positive. There is however the minor issue that $$p_0-0 = p_1-1 = 2$$, so you are picking up a $$2$$-year old variant twice. This does not seem to be against the rules, though you may need to shift one pickup by a day or so in the variant's timeline so the two pickups don't interfere with each other. If it is against the rules, you can swap the primes $$3$$ and $$5$$ so that $$p_1=5$$ and $$p_2=3$$, and then also swap the primes $$7$$ and $$11$$ to avoid picking up a $$4$$-year old twice.

• This is a brilliant answer! Here I was writing a program to solve it. Commented Feb 24, 2022 at 22:34
• The way I found it is by the realisation that you never need to wait more than a year between one pickup and the next. You can always delay the first of those two pickups to a year before the second by picking up a later version. Therefore you can shift all the pickups together to the end with just one waiting period before the first. Commented Feb 25, 2022 at 5:20