Skip to main content
1 of 4
Carlo Beenakker
  • 188.3k
  • 18
  • 448
  • 651

For the record (not an answer), the function $a(n-1,n)$ for $n$ up to $10^4$ contains 2264 distinct primes, the largest being equal to 20369. The growth rate of the primes is close to linear in $n$, see plot.


Mathematica code

out=Table[{t=RecurrenceTable[{a[m]==a[m-1]+GCD[a[m-1],n-m],a[0]==n},a,{m, 1,n-1}];{n,t[[n-1]],PrimeQ[t[[n-1]]]}},{n,2,10000}]; And @@ out[[All,1,3]] ListPlot[out[[All,1,2]]]

Carlo Beenakker
  • 188.3k
  • 18
  • 448
  • 651