login
A270139
a(n)=n when n<=3, otherwise a(n) is the smallest unused positive integer which is not coprime to the two previous terms.
11
1, 2, 3, 6, 9, 12, 15, 10, 5, 20, 25, 30, 35, 14, 7, 21, 28, 18, 4, 8, 16, 22, 24, 26, 32, 34, 36, 38, 40, 42, 44, 33, 11, 55, 66, 45, 27, 39, 48, 51, 54, 57, 60, 63, 56, 49, 70, 77, 84, 88, 46, 50, 52, 58, 62, 64, 68, 72, 74, 76, 78, 80, 65, 75, 85, 90, 95, 100, 105, 96
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
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
KEYWORD
nonn
AUTHOR
Ivan Neretin, Mar 11 2016
STATUS
approved