login
a(n)=n for n<=4; for n>4, a(n) is the smallest integer greater than a(n-1) that shares common factors with some (i.e., at least one) but not all of previous 4 terms.
1

%I #14 Dec 21 2016 18:40:19

%S 1,2,3,4,6,8,9,10,14,15,16,21,22,25,26,27,28,32,33,34,35,36,38,39,40,

%T 44,45,46,51,52,55,56,57,58,62,63,64,68,69,70,74,75,76,77,78,80,81,82,

%U 85,86,87,88,92,93,94,98,99,100,104,105,106,111,112,115,116,117,118,122

%N a(n)=n for n<=4; for n>4, a(n) is the smallest integer greater than a(n-1) that shares common factors with some (i.e., at least one) but not all of previous 4 terms.

%H Robert Israel, <a href="/A080823/b080823.txt">Table of n, a(n) for n = 1..10000</a>

%F For n >= 119, a(n) = a(n-113) + 210. - _Robert Israel_, Dec 21 2016

%p for n from 1 to 4 do A[n]:= n od:

%p for n from 5 to 100 do

%p for k from A[n-1]+1 do

%p L:= map(igcd, [seq(A[i],i=n-4..n-1)],k);

%p if max(L)>1 and min(L)=1 then A[n]:= k; break fi

%p od

%p od:

%p seq(A[i],i=1..100); # _Robert Israel_, Dec 21 2016

%Y Cf. A079279.

%K easy,nonn

%O 1,2

%A _Matthew Vandermast_, Mar 26 2003

%E a(5)=6 inserted by _Robert Israel_, Dec 21 2016