OFFSET
1,2
COMMENTS
Ordinal transform of the ordinal transform of the nextprime function, A151800(1..) = 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, ...
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
For all n >= 1, a(A008578(n)) = n.
MATHEMATICA
A175851[n_] := If[!CompositeQ[n], 1, n - NextPrime[n, -1] + 1];
b[_] = 0;
a[n_] := a[n] = With[{t = A175851[n]}, b[t] = b[t] + 1];
Array[a, 105] (* Jean-François Alcover, Dec 21 2021 *)
PROG
(PARI)
up_to = 65537;
A151800(n) = nextprime(1+n);
ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om, invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om, invec[i], (1+pt))); outvec; };
v304106 = ordinal_transform(ordinal_transform(vector(up_to, n, A151800(n))));
A304106(n) = v304106[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 09 2018
STATUS
approved