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 A115317 #12 Nov 15 2021 07:10:53 %S A115317 1,2,6,8,4,5,10,3,12,14,9,11,16,7,18,20,15,17,22,13,24,25,21,26,23,19, %T A115317 27,28,29,30,31,32,33,34,36,37,35,43,41,38,42,39,40,53,47,44,61,45,46, %U A115317 71,48,59,57,49,50,63,51,52,89,67,54,68,55,56,74,73,58,107,60,79,113,62 %N A115317 a(n) = A115316(A115316(n)). %C A115317 Inverse integer permutation of A115319; %C A115317 A115318(a(n)) = a(A115318(n)) = A115316(n). %H A115317 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A115317 nmax = 72; (* length of this sequence *) %t A115317 nn = nmax + 20 (* estimated length of A115316 - should be increased if insufficient *); %t A115317 np = Ceiling[nn/3] + 1; %t A115317 nc = Ceiling[(2/3) nn]; %t A115317 pp = Prime[Range[np]]; %t A115317 cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2]; %t A115317 A115316 = Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; nn]]; %t A115317 a[n_] := A115316[[A115316[[n]]]]; %t A115317 Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, Nov 15 2021 *) %Y A115317 Cf. A115316, A115318, A115319. %K A115317 nonn %O A115317 1,2 %A A115317 _Reinhard Zumkeller_, Jan 20 2006