OFFSET
1,2
COMMENTS
In the first 100000 terms the smallest unseen number is 14657, although it is likely all numbers eventually appear. In the same range the fixed points are 3, 8, 11, 69, 207, 543, 555, 663, 687, 981. The majority of terms more than n = 100000 appear to move away from the line y = n, see the linked image, so it is unclear if more exist. The largest value in the first 100000 terms is a(87952) = 4758245.
LINKS
Scott R. Shannon, Image of the first 100000 terms for values less than 150000. The green line is y = n.
Scott R. Shannon, Image of the first 100000 terms.
EXAMPLE
a(3) = 3 as a(1)+a(2) = 3, gcd(1,3) = 1, gcd(2,3) = 1, gcd(3,3) > 1 and 3 is unused.
a(4) = 5 as a(2)+a(3) = 5, gcd(2,5) = 1, gcd(3,5) = 1, gcd(5,5) > 1 and 5 is unused.
a(8) = 8 as a(6)+a(7) = 22, gcd(9,8) = 1, gcd(13,8) = 1, gcd(22,8) > 1 and 8 is unused.
MATHEMATICA
a[1]=1; a[2]=2; a[n_]:=a[n]=(k=2; While[MemberQ[Array[a, n-1], k]||GCD[a[n-2]+a[n-1], k]<=1||GCD[a[n-2], k]!=1||GCD[a[n-1], k]!=1, k++]; k); Array[a, 74] (* Giorgos Kalogeropoulos, Nov 20 2021 *)
PROG
(Python)
from math import gcd
terms, appears = [1, 2], {2:True}
for n in range(3, 100):
t = 3
while not(appears.get(t) is None and gcd(terms[-2]+terms[-1], t)>1 and gcd(terms[-2], t)==1 and gcd(terms[-1], 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 20 2021
STATUS
approved