cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A270139 #15 Oct 13 2020 14:38:09
%S A270139 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,
%T A270139 36,38,40,42,44,33,11,55,66,45,27,39,48,51,54,57,60,63,56,49,70,77,84,
%U A270139 88,46,50,52,58,62,64,68,72,74,76,78,80,65,75,85,90,95,100,105,96
%N 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.
%C A270139 Other possible conditions on a(n) with respect to its common factors with a(n-2) and a(n-1) lead to the following:
%C A270139 Coprime to both: A084937.
%C A270139 Coprime to the latter and not the former: A098550.
%C A270139 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.
%C A270139 Coprime to the latter, regardless of the former: simply A000027.
%C A270139 Coprime to the former, regardless of the latter: A121216.
%C A270139 Non-coprime to the latter, regardless of the former: A064413.
%C A270139 Non-coprime to the former, regardless of the latter: A121217.
%H A270139 Ivan Neretin, <a href="/A270139/b270139.txt">Table of n, a(n) for n = 1..10000</a>
%e A270139 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.
%t A270139 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
%Y A270139 Cf. A064413, A084937, A098550, A121216, A121217, A254077, A255582, A336957.
%K A270139 nonn
%O A270139 1,2
%A A270139 _Ivan Neretin_, Mar 11 2016