OFFSET
1,4
COMMENTS
Ordinal transform of f, where f(1) = 0 and f(n) = A002322(n) for n > 1.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
Except for a(2) = 1, a(n) = A303756(n).
MATHEMATICA
a[1] = 1; a[n_] := With[{c = CarmichaelLambda[n]}, Select[Range[2, n], c == CarmichaelLambda[#]&] // Length];
Array[a, 1000] (* Jean-François Alcover, Sep 19 2020 *)
PROG
(PARI)
up_to = 65537;
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; };
Aux303758(n) = if(1==n, 0, A002322(n));
v303758 = ordinal_transform(vector(up_to, n, Aux303758(n)));
A303758(n) = v303758[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 30 2018
STATUS
approved