login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A115318
Inverse of A115316.
3
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,2
FORMULA
a(a(n)) = A115319(n).
a(n) = A115316(A115319(n)) = A115319(A115316(n)).
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 *)
CROSSREFS
Sequence in context: A186631 A359478 A182184 * A338060 A169856 A185112
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 20 2006
STATUS
approved