Ponder This Challenge - February 2026 - Blot-avoiding backgammon strategy
- Ponder This
This riddle was proposed by Marco Bellocchi - thanks Marco!
Define a sequence recursively by setting where denotes the greatest common divisor (GCD) of the pair of numbers x, y.
For example, when we have since , and we have because .
Continuing, we arrive at the sequence:
11, 12, 15, 16, 17, 18, 19, 20, 21, 22, 33, 36,...
We now look at the sequence of differences beginning from , :
1, 3, 1, 1, 1, 1, 1, 1, 1, 11, 3, ...
(i.e., is the first element of the sequence, is the second, etc.)
A curious property enjoyed by this sequence is that it contains only the number 1 and the prime numbers 3, 11. If we continue this sequence long enough and erase all the occurrences of 1, we arrive at this sequence
3, 11, 3, 23, 3, 47, 3, 5, 3, 101, 3, 7, 11, 3, 13, 233, 3, 467, 3, 5, 3, 941, 3, 7, 1889, ...
which contains only prime numbers. It can be proven that indeed, when , all elements of the sequence obtained in this manner will be prime.
Returning to the original difference sequence, it is easy to see that and these are the first 5 occurrences of 3 in the sequence. Hence, 3 appears for the fifth time for .
Your goal: For the sequence defined by , find the value of for which 5 appears for the tenth time.
In addition, find values such that for the sequence defined by the initial value , we have but not a prime.
A Bonus "*" will be given for finding, for the sequence defined by , the value of for which 5 appears for the 200th time.
We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!
We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.
If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com
September 2023 Solution:
The solutions are 79820644 and 202373481820525416280764330407686074634 (, depending on how you're counting).
The paper ["A Natural Prime-Generating Recurrence"] by Eric S. Rowland gives a good overview of this this nice prime-generation method. While the main solution can be reached by rather naive programming, the bonus one requires additional tricks, and Rowland gives a nice trick allowing to bypass the "1" elements of the sequence, with the price being the need to factor numbers (or rather, find the smallest factor)