login
a(n) = A115316(A115316(n)).
2

%I #12 Nov 15 2021 07:10:53

%S 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 27,28,29,30,31,32,33,34,36,37,35,43,41,38,42,39,40,53,47,44,61,45,46,

%U 71,48,59,57,49,50,63,51,52,89,67,54,68,55,56,74,73,58,107,60,79,113,62

%N a(n) = A115316(A115316(n)).

%C Inverse integer permutation of A115319;

%C A115318(a(n)) = a(A115318(n)) = A115316(n).

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%t nmax = 72; (* length of this sequence *)

%t nn = nmax + 20 (* estimated length of A115316 - should be increased if insufficient *);

%t np = Ceiling[nn/3] + 1;

%t nc = Ceiling[(2/3) nn];

%t pp = Prime[Range[np]];

%t cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];

%t A115316 = Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; nn]];

%t a[n_] := A115316[[A115316[[n]]]];

%t Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, Nov 15 2021 *)

%Y Cf. A115316, A115318, A115319.

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, Jan 20 2006