A115318 Inverse of A115316.
1, 2, 5, 3, 8, 4, 11, 6, 7, 9, 14, 10, 17, 12, 13, 15, 20, 16, 23, 18, 19, 21, 26, 22, 24, 25, 27, 28, 29, 30, 32, 31, 33, 34, 36, 37, 35, 39, 40, 42, 38, 43, 41, 45, 46, 48, 44, 49, 51, 52, 54, 55, 47, 57, 58, 60, 61, 63, 50, 64, 53, 66, 67, 69, 70, 72, 56, 73, 75, 76, 59, 78
Offset: 1
Keywords
Programs
-
Mathematica
nmax = 72; nn = nmax + 10; (* 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]]; a[n_] := FirstPosition[A115316, n][[1]]; Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 15 2021 *)
Comments