OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A000010(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.
MATHEMATICA
f[1] = 1; f[n_] := f[n] = (EulerPhi[n] - DivisorSum[n, f[#]*f[n/#] &, 1 < # < n &])/2; Numerator @ Array[f, 100] (* Amiram Eldar, Dec 12 2022 *)
PROG
(PARI)
A317925perA317926(n) = if(1==n, n, (eulerphi(n)-sumdiv(n, d, if((d>1)&&(d<n), A317925perA317926(d)*A317925perA317926(n/d), 0)))/2);
A317925(n) = numerator(A317925perA317926(n));
(PARI)
\\ Memoized implementation:
memo = Map();
A317925perA317926(n) = if(1==n, n, if(mapisdefined(memo, n), mapget(memo, n), my(v = (eulerphi(n)-sumdiv(n, d, if((d>1)&&(d<n), A317925perA317926(d)*A317925perA317926(n/d), 0)))/2); mapput(memo, n, v); (v)));
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Antti Karttunen, Aug 11 2018
STATUS
approved