Prime Generating Recurrence
- 24Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Define the recurrence R(n) and give its initial term for the sequence discussed.
24 questions
- 1
Define the recurrence R(n) and give its initial term for the sequence discussed.
Model answer
R(1) = 7, and for n > 1, R(n) = R(n-1) + gcd(n, R(n-1)).
Explanation
The recurrence is defined with initial term 7, and each subsequent term adds the gcd of the index and the previous term.
- 2
Compute R(2) and R(3) for the recurrence with initial term 7.
Model answer
R(2) = 8, R(3) = 9.
Explanation
gcd(2,7)=1 so R(2)=7+1=8; gcd(3,8)=1 so R(3)=8+1=9.
- 3
What is the first value of n for which the gcd is not 1, and what is that gcd?
Model answer
n=5 gives gcd(5,10)=5.
Explanation
At n=5, R(4)=10, so gcd(5,10)=5, the first nontrivial gcd.
- 4
What is observed about all nontrivial gcds (those not equal to 1) in the sequence R(n)?
Model answer
They are all prime numbers.
Explanation
When the gcd is not 1, it turns out to always be prime, as seen in the data.
- 5
Explain the 'warped Fibonacci' analogy for the recurrence R(n).
Model answer
Like Fibonacci, each term is the sum of the previous term and something else, but here that something else is the gcd of n and the previous term, not the term before that.
Explanation
Fibonacci adds two previous terms; this recurrence adds the previous term and a gcd, which depends on the index.
- 6
What is the sequence of gcds for the first few terms of R(n) with initial term 7?
Model answer
The gcds are: gcd(2,7)=1, gcd(3,8)=1, gcd(4,9)=1, gcd(5,10)=5, gcd(6,15)=3, then several more 1s before the next prime.
Explanation
The gcds are 1 until n=5, then 5, then 3, then mostly 1s again.
- 7
Describe the behavior of the sequence R(n) in terms of 'boring' stretches and sudden jumps.
Model answer
The sequence mostly increases by 1 (when gcd is 1), but occasionally jumps by a larger amount (when gcd is a prime).
Explanation
Most steps are +1; the jumps correspond to nontrivial gcds, which are primes.
- 8
What pattern was noticed when looking at the primes 5, 11, 23, 47?
Model answer
Each prime (except 5) is roughly 2 times the previous prime plus 1: 25+1=11, 211+1=23, 2*23+1=47.
Explanation
This doubling relation holds for these primes but does not continue (2*47+1=95 is not prime and does not appear).
- 9
Why is a logarithmic scale used when plotting the indices where nontrivial gcds occur?
Model answer
Because the indices grow rapidly, a logarithmic scale compresses the data so that the pattern of clusters becomes visible.
Explanation
The indices span many orders of magnitude, so log scale reveals roughly constant vertical spacing between clusters, corresponding to multiplicative growth.
- 10
What did the logarithmic plot of the indices of nontrivial gcds reveal?
Model answer
The primes appear in clusters, and the average indices of clusters are roughly separated by a constant factor of about 2 on the log scale.
Explanation
This means the length of the runs of 1s between clusters roughly doubles each time.
- 11
State the full conjecture about predicting the next nontrivial gcd in the recurrence.
Model answer
If the current index n has a nontrivial gcd, then the next nontrivial gcd is the smallest prime divisor of 2n-1, and it appears at index n + (p-1)/2.
Explanation
The conjecture provides both the value and the position of the next nontrivial gcd, skipping over all ones.
- 12
According to the conjecture, how do you compute the next nontrivial gcd from the current index n?
Model answer
Let p be the smallest prime divisor of 2n-1; then the next nontrivial gcd is p, and it occurs at index n + (p-1)/2.
Explanation
This gives a direct formula without computing intermediate R values.
- 13
What is the key condition on R(n) that allows the conjecture to be applied repeatedly?
Model answer
The condition is that R(n) = 3n whenever a nontrivial gcd occurs (i.e., at the start of each cluster).
Explanation
This 'nice situation' ensures that after each jump, the recurrence returns to the same form, enabling iteration of the shortcut.
- 14
Explain why the primes appear in clusters rather than uniformly.
Model answer
When 2n-1 is composite, its smallest prime divisor p is small, so the run of 1s (p-1)/2 is short; when 2n-1 is prime, the run is n-1, which is long, creating a new cluster.
Explanation
Short runs produce dense clusters; a long run separates clusters.
- 15
Why is the prime 2 never produced as a nontrivial gcd?
Model answer
Because 2n-1 is always odd, so its smallest prime divisor can never be 2.
Explanation
The formula for the next gcd involves 2n-1, which is odd, so 2 is excluded.
- 16
Is it known whether all odd primes eventually appear in the sequence?
Model answer
No; it is not known if every odd prime appears. Infinitely many distinct primes do appear, but some primes (e.g., 587 after 10000 steps) have not yet appeared.
Explanation
The question of which primes appear is open, though infinite distinct primes have been proven.
- 17
Why is the recurrence not practical for finding large primes?
Model answer
To find a large prime p, one must run the recurrence for about (p-1)/2 steps, and using the shortcut requires testing 2n-1 for primality, which is as hard as the original problem.
Explanation
The shortcut does not help because it requires an independent primality test to identify the next prime.
- 18
What happens when the initial term is changed to 1?
Model answer
The sequence becomes R(n)=n, so all gcds are 1 and no primes appear.
Explanation
R(1)=1, then gcd(2,1)=1 gives R(2)=2, etc., so R(n)=n and gcd(n,n-1)=1 always.
- 19
What is observed when the initial term is 4?
Model answer
After a few steps, it matches the sequence starting with 7; specifically, R(3)=9, the same as the original sequence from that point onward.
Explanation
R(2)=4+2=6, R(3)=6+3=9, and from n=3, it coincides with the sequence starting at 7.
- 20
Describe the behavior of the sequence with initial term 532.
Model answer
Initially, some nontrivial gcds are not prime (e.g., a non-prime appears), but eventually at n=279, R(279)=3*279, and after that all gcds are prime or 1.
Explanation
The sequence eventually enters the 3n state, after which the theorem applies and primes are generated.
- 21
What open question remains about initial terms greater than or equal to 4?
Model answer
It is conjectured that for any initial term ≥4, the sequence eventually reaches a state where R(n)=3n, but this has not been proven.
Explanation
This is an open problem; the sequence with initial 532 provides evidence but not proof.
- 22
Define the LCM variant C(n) and its recurrence.
Model answer
C(1)=1, and for n>1, C(n)=C(n-1)+lcm(n, C(n-1)).
Explanation
This variant replaces gcd with lcm in the recurrence.
- 23
What interesting property does the ratio C(n)/C(n-1) have?
Model answer
The quantity C(n)/C(n-1) - 1 = lcm(n, C(n-1))/C(n-1) is always either 1 or a prime number.
Explanation
This has been observed but not proven; it is an open problem related to primes in arithmetic progressions.
- 24
Has the property of the LCM variant been proven?
Model answer
No, it remains unproven, and Ruiz-Cabello showed it is connected to a difficult open question about primes in arithmetic progressions.
Explanation
Unlike the original recurrence, the LCM variant's property is not yet proven.

Ask anything
We've read this whole study set, so questions about it get the best answers.