login
a(n) = n if n <= 3, otherwise a(n) is the smallest number not occurring earlier such that gcd(a(n-2), a(n)) is a prime and gcd(a(n-1), a(n)) = 1.
5

%I #37 Aug 01 2019 04:12:31

%S 1,2,3,4,9,10,21,5,6,25,8,15,14,27,7,12,35,22,45,11,20,33,26,51,13,17,

%T 39,34,57,16,19,18,95,28,55,38,65,24,85,46,75,23,36,115,58,69,29,30,

%U 203,32,49,50,63,44,87,62,81,31,42,155,52,93,70,99,64,77,54

%N a(n) = n if n <= 3, otherwise a(n) is the smallest number not occurring earlier such that gcd(a(n-2), a(n)) is a prime and gcd(a(n-1), a(n)) = 1.

%C The sequence is infinite because the term P*p is always a candidate for a(n), where p is a prime factor of a(n-2) and P is a prime not dividing any of a(1),..., a(n-1).

%C Moreover, this sequence conjecturally is a permutation of the positive integers: the proof i-v for A098550 applies with essentially no changes, while vi still has a difficulty.

%H Peter J. C. Moses, <a href="/A256189/b256189.txt">Table of n, a(n) for n = 1..1000</a>

%H David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, <a href="http://arxiv.org/abs/1501.01669">The Yellowstone Permutation</a>, arXiv preprint arXiv:1501.01669 [math.NT], 2015.

%t a[1]=1; a[2]=2; a[3]=3;

%t A256189 = {1, 2, 3};

%t a[n_] := a[n] = For[k=4, True, k++, If[FreeQ[A256189, k], If[PrimeQ[GCD[ a[n-2], k]] && GCD[a[n-1], k] == 1, AppendTo[A256189, k]; Return[k]]]];

%t A256189 = Array[a, 100] (* _Jean-François Alcover_, Aug 02 2018 *)

%Y Cf. A098550, A256224, A256224.

%K nonn

%O 1,2

%A _Vladimir Shevelev_, Mar 19 2015

%E More terms from _Peter J. C. Moses_, Mar 24 2015