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 A159193 #5 Jul 09 2015 17:20:55 %S A159193 1,4,6,2,10,3,14,12,15,5,22,8,26,7,9,18,34,16,38,24,27,11,46,20,30,13, %T A159193 21,32,58,25,62,28,36,17,40,33,74,19,42,35,82,39,86,48,50,23,94,44,56, %U A159193 45,54,60,106,51,65,49,63,29,118,52,122,31,57,66,55,64,134,70,72,68,142 %N A159193 a(n) is the smallest positive integer not yet in the sequence with gcd(n,a(n)) > 1 but a(n) != n; a(1) = 1 by convention. %C A159193 This is a permutation of the positive integers with a(a(n)) = n. %C A159193 Does every positive rational occur as a value of a(n)/n? %H A159193 Ivan Neretin, <a href="/A159193/b159193.txt">Table of n, a(n) for n = 1..10000</a> %t A159193 a = {1}; Do[AppendTo[a, Complement[Select[Range[Max[a] + 2 n], GCD[#, n] > 1 &], a, {n}][[1]]], {n, 2, 71}]; a (* _Ivan Neretin_, Jul 09 2015 *) %o A159193 (PARI) va(n) = local(v); v=vector(n);v[1]=1;for(k=2,n,v[k]=na(v,k));v %o A159193 na(v, k) = for(i=1,2*k,if(gcd(i,k)>1&&i!=k,if(!inv(v,k-1,i),return(i)))) %o A159193 inv(v, k, x) = for(i=1,k,if(v[i]==x,return(1)));return(0) %K A159193 nonn %O A159193 1,2 %A A159193 _Franklin T. Adams-Watters_, Apr 05 2009