Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A115319
a(n) = A115318(A115318(n)).
3
1, 2, 8, 5, 6, 3, 14, 4, 11, 7, 12, 9, 20, 10, 17, 13, 18, 15, 26, 16, 23, 19, 25, 21, 22, 24, 27, 28, 29, 30, 31, 32, 33, 34, 37, 35, 36, 40, 42, 43, 39, 41, 38, 46, 48, 49, 45, 51, 54, 55, 57, 58, 44, 61, 63, 64, 53, 67, 52, 69, 47, 72, 56, 75, 76, 78, 60, 62, 81, 82, 50, 85
OFFSET
1,2
COMMENTS
Inverse integer permutation of A115317.
FORMULA
A115316(a(n)) = a(A115316(n)) = A115318(n).
MATHEMATICA
nmax = 72;
nn = nmax + 15; (* estimated length of A115316 - should be increased in case of message "NotFound" in the output *)
np = Ceiling[nn/3] + 1;
nc = Ceiling[(2/3) nn];
pp = Prime[Range[np]];
cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];
A115316 = Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; nn]];
A115318[n_] := FirstPosition[A115316, n][[1]];
a[n_] := A115318[A115318[n]];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 15 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 20 2006
STATUS
approved