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.
%I A247942 #36 Jan 15 2015 10:18:49 %S A247942 1,2,3,4,9,8,15,14,5,6,7,10,21,16,25,12,35,18,49,20,27,22,39,11,13,24, %T A247942 55,26,33,28,45,32,51,38,17,19,30,119,36,65,34,57,40,63,44,69,50,23, %U A247942 42,85,46,75,52,81,56,87,62,29,31,48 %N A247942 a(n) = n if n <= 3, otherwise the smallest number not occurring earlier having at least one common factor with a(n-2)*a(n-3), but none with a(n-1). %C A247942 The sequence differs from A098550 from a(11) onward. %C A247942 The sequence is a permutation of the natural numbers. The proof is similar to that for A098550 (with minor changes). - _Vladimir Shevelev_, Jan 14 2015 %H A247942 Robert Israel, <a href="/A247942/b247942.txt">Table of n, a(n) for n = 1..10000</a> %H A247942 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, 2015. %p A247942 for n from 1 to 3 do %p A247942 a[n]:= n: %p A247942 b[n]:= 1: %p A247942 od: %p A247942 for n from 4 to 1000 do %p A247942 q:= a[n-2]*a[n-3]; %p A247942 for k from 4 do %p A247942 if not assigned(b[k]) and igcd(k,q) > 1 and igcd(k,a[n-1]) = 1 then %p A247942 a[n]:= k; %p A247942 b[k]:= 1; %p A247942 break %p A247942 fi %p A247942 od: %p A247942 od: %p A247942 seq(a[i],i=1..1000); # _Robert Israel_, Jan 12 2015 %t A247942 a[n_ /; n <= 3] := n; a[n_] := a[n] = For[aa = Table[a[j], {j, 1, n-1}]; k=4, True, k++, If[FreeQ[aa, k] && !CoprimeQ[k, a[n-2]*a[n-3]] && CoprimeQ[k, a[n-1]], Return[k]]]; Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Jan 12 2015 *) %Y A247942 Cf. A098550, A249167, A251604, A247225. %K A247942 nonn %O A247942 1,2 %A A247942 _Vladimir Shevelev_, Jan 11 2015 %E A247942 More terms from _Jean-François Alcover_, Jan 12 2015