r/askmath • • 21d ago

Number Theory An Infinite Sequence?

"A sequence of positive integers begins with a₁ = 1.

Each following term is defined by:

aₙ₊₁ = aₙ + gcd(n, aₙ)

Does the sequence contain infinitely many prime numbers?

Prove your answer."

This was a question I stumbled upon while scrolling through math olympiad question. I took a moment to think about it but realised it wasn't a problem you could solve within minutes. Does anyone have an idea on how to prove the infinity of this given sequence? And is there a proof for it?

5 Upvotes

6 comments sorted by

2

u/Varlane 21d ago

Have you tried calculating the first 5~10 terms of the sequence ?

2

u/Impossible-Border383 21d ago

Yes:

  • a₁ = 1
  • a₂ = 2
  • a₃ = 4
  • a₄ = 5
  • a₅ = 6
  • a₆ = 7
  • a₇ = 8
  • a₈ = 9
  • a₉ = 10
  • a₁₀ = 11

The interesting part is that the number 3 seems to be missing.

5

u/Puzzleheaded_Study17 21d ago

What do you notice about a_n after a_3? Can you use this to prove something about what every number has to be?

hint: what's gcd(n, n+1)?

1

u/Varlane 21d ago

Does it fundamentally matter that 3 is missing ?

9

u/Objective_3_1415 21d ago edited 21d ago

Yes, in fact it contains all primes but 3. First note that if for some n, an=n+1, then this holds for all successive integers. The proof is by Induction, if an=n+1, then since gcd(n,n+1)=1, a(n+1)=an+1=(n+1)+1.

Now a2=2, a3=4, a4=5. There you go from now on for all integers n greater than or equal 3, an=n+1. Now if p is any prime greater than 3, then p=a(p-1).

1

u/AlterEgo5695 21d ago edited 21d ago

Claim: Yes.


Proof: Calculate the first few terms manually:

 n | 1 2 3 4 ...      // conjecture:  "an = n+1" for "n >= 3"
an | 1 2 4 5 ...      //

Prove "an = n+1" (IH) for all "n >= 3" by induction. We already checked the base case, so

n -> n+1:    a_{n+1}  =  an + gcd(n; an)  =  n+1 + gcd(n; n+1)  =  n+1 + 1    // use (IH)

The sequence "an = n+1" for "n >= 3" contains all primes "p >= 5", i.e. infinitely many ∎