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 A026239 #23 Mar 05 2015 10:56:22 %S A026239 1,4,6,2,8,3,9,5,7,11,10,13,12,17,19,23,14,29,15,31,37,41,16,43,47,53, %T A026239 59,61,18,67,20,71,73,79,83,89,21,97,101,103,22,107,24,109,113,127,25, %U A026239 131,137,139,149,151,26,157,163,167,173,179,27,181,28,191,193,197,199 %N A026239 Beginning with the natural numbers, swap the k-th prime and k-th composite. %C A026239 Involution (self-inverse permutation) of [positive] natural numbers. %H A026239 Alois P. Heinz, <a href="/A026239/b026239.txt">Table of n, a(n) for n = 1..10000</a> %H A026239 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A026239 a(1) = 1 and a(n) = if n is prime then A002808(A049084(n)) else A000040(A066246(n)) for n>1. - _Reinhard Zumkeller_, Dec 13 2001 %t A026239 Composite[n_Integer] := FixedPoint[n + PrimePi@# + 1 &, n + PrimePi@n + 1]; f[1] = 1; f[n_] := If[ PrimeQ@n, Composite@ PrimePi@n, Prime[n - 1 - PrimePi@n]]; Array[f, 65] (* _Robert G. Wilson v_, Jun 08 2010 *) %o A026239 (Haskell) %o A026239 a026239 1 = 1 %o A026239 a026239 n | a010051 n == 1 = a002808 $ a049084 n %o A026239 | otherwise = a000040 $ a066246 n %o A026239 -- _Reinhard Zumkeller_, Mar 30 2014 %Y A026239 Cf. A236854. %K A026239 nonn %O A026239 1,2 %A A026239 _Clark Kimberling_ %E A026239 More terms from _Robert G. Wilson v_, Jun 08 2010