OFFSET
1,2
COMMENTS
Other possible conditions on a(n) with respect to its common factors with a(n-2) and a(n-1) lead to the following:
Coprime to both: A084937.
Coprime to the latter and not the former: A098550.
Coprime to the former and not the latter: with any initial conditions, the sequence "paints itself into a corner", i.e., is finite. With the added condition of a(n) having an extra prime factor not contained in a(n-1), it is A336957.
Coprime to the latter, regardless of the former: simply A000027.
Coprime to the former, regardless of the latter: A121216.
Non-coprime to the latter, regardless of the former: A064413.
Non-coprime to the former, regardless of the latter: A121217.
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
EXAMPLE
a(12) = 30, a(13) = 35, so a(14) must have common factors (possibly different) with 30 and 35, and the smallest unused number with that property turns out to be 14, so a(14) = 14.
MATHEMATICA
a = {1, 2, 3}; Do[k = 1; While[(MemberQ[a, k] || GCD[a[[-1]], k] == 1 || GCD[a[[-2]], k] == 1), k++]; AppendTo[a, k], {n, 2, 68}]; a
CROSSREFS
KEYWORD
nonn
AUTHOR
Ivan Neretin, Mar 11 2016
STATUS
approved