login
a(1) = 1, a(2) = 3; thereafter a(n) is the smallest odd positive integer not yet occurring in the sequence such that gcd(a(n), a(n-1)) > 1.
3

%I #24 Oct 29 2020 20:32:18

%S 1,3,9,15,5,25,35,7,21,27,33,11,55,45,39,13,65,75,51,17,85,95,19,57,

%T 63,49,77,91,105,69,23,115,125,135,81,87,29,145,155,31,93,99,111,37,

%U 185,165,117,123,41,205,175,119,133,147,129,43,215,195,141,47,235,225,153

%N a(1) = 1, a(2) = 3; thereafter a(n) is the smallest odd positive integer not yet occurring in the sequence such that gcd(a(n), a(n-1)) > 1.

%C From _Matthew Vandermast_, Nov 21 2009: (Start)

%C Odd analog of the EKG sequence. Cf. A064413.

%C In contrast to A064413, there are at least 2 different patterns by which primes > a(2) are introduced into the sequence. 5 is the first of many primes p that are immediately preceded in the sequence by 3p and immediately followed by 5p. For p = 7, 19, or 31, p is immediately preceded by 5p and immediately followed by 3p. (End)

%C In fact, based on the first 10000 terms, it appears that apart from the three exceptions 7, 19, and 31, primes p are always preceded by 3*p and followed by 5*p. The graph is very similar to the graph of the EKG sequence. - _N. J. A. Sloane_, Oct 29 2020

%H N. J. A. Sloane, <a href="/A152247/b152247.txt">Table of n, a(n) for n = 1..10000</a>

%p M:= 10000;

%p N:= 100000;

%p V:= Array(0..100000,0): # V = hit?

%p A[1]:= 1: # A = sequence

%p A[2]:= 3: V[3]:= 1:

%p for n from 3 to M do # get candidates S for next term

%p sw:=-1;

%p S:= {seq(seq(k*p, k=1..N/p), p=numtheory:-factorset(A[n-1]))};

%p for s in sort(convert(S, list)) do

%p if type(s,odd) and V[s] = 0 then

%p A[n]:= s; V[s]:=1; sw := 1; break; fi;

%p od;

%p if sw=-1 then lprint("n not found",n); break; fi;

%p od: # od n

%p [seq(A[i], i=1..1000]; # _N. J. A. Sloane_, Oct 29 2020

%Y Cf. A064413, A098550, A100113, A152248.

%K nonn

%O 1,2

%A _Leroy Quet_, Nov 30 2008

%E Extended by _Ray Chandler_, Dec 05 2008