OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A303757(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.
MATHEMATICA
A303757[n_] := If[n == 2, 1, Count[EulerPhi[Range[n]] - EulerPhi[n], 0]];
f[n_] := f[n] = If[n == 1, 1, (1/2)(A303757[n] -
Sum[If[1<d<n, f[d] f[n/d], 0], {d, Divisors[n]}])];
a[n_] := Numerator[f[n]];
Array[a, 105] (* Jean-François Alcover, Dec 20 2021 *)
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; };
DirSqrt(v)={my(n=#v, u=vector(n)); u[1]=1; for(n=2, n, u[n]=(v[n]/v[1] - sumdiv(n, d, if(d>1&&d<n, u[d]*u[n/d], 0)))/2); u}; \\ From A317937.
v303757 = ordinal_transform(vector(up_to, n, if(1==n, 0, eulerphi(n))));
v317847 = DirSqrt(vector(up_to, n, v303757[n]));
A317847(n) = numerator(v317847[n]);
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Aug 14 2018
STATUS
approved