OFFSET
1,2
COMMENTS
The majority of terms lie near a line of gradient 1, but some terms show extremely large jumps in value, e.g., in the first 30000 terms the largest value is a(25391) = 87893333254. It is likely all numbers eventually appear although this is unknown. In the same range, and other than a(3) = 3, there are twenty-one fixed points all between 626 to 856 inclusive. As the terms for n>30000 appear both above and below the line y = n it is possible more exist although this is unknown.
LINKS
Scott R. Shannon, Image for the first 10000 points with values below 20000. The green line is y = n.
Scott R. Shannon, Image of the first 30000 terms. On this scale the vast majority of terms lie along the x-axis.
EXAMPLE
a(3) = 3 as a(2)+3 = 9, gcd(9,3)>1, gcd(6,3)>1, gcd(3,3)>1 and 3 has not been used.
a(4) = 42 as a(3)+4 = 7, gcd(7,42)>1, gcd(3,42)>1, gcd(4,42)>1 and 42 has not been used.
a(5) = 470 as a(4)+5 = 47, gcd(47,470)>1, gcd(42,470)>1, gcd(5,470)>1 and 470 has not been used.
a(6) = 2 as a(5)+6 = 476, gcd(476,2)>1, gcd(470,2)>1, gcd(6,2)>1 and 2 has not been used.
MATHEMATICA
a[1]=1; a[2]=6; a[n_]:=a[n]=(k=2; While[MemberQ[Array[a, n-1], k]||GCD[a[n-1]+n, k]<=1||GCD[a[n-1], k]<=1||GCD[n, k]<=1, k++]; k); Array[a, 65] (* Giorgos Kalogeropoulos, Nov 20 2021 *)
PROG
(Python)
from math import gcd
terms, appears = [1, 6], {6:True}
for n in range(3, 100):
t = 2
while not (appears.get(t) is None and gcd(terms[-1]+n, t)>1 and gcd(terms[-1], t)>1 and gcd(n, t)>1):
t += 1
appears[t] = True; terms.append(t)
print(terms) # Gleb Ivanov, Nov 20 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Nov 19 2021
STATUS
approved