OFFSET
1,4
COMMENTS
The first negative term is a(210) = -7.
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) * (A001221(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.
PROG
(PARI)
A317937aux(n) = if(1==n, n, (omega(n)-sumdiv(n, d, if((d>1)&&(d<n), A317937aux(d)*A317937aux(n/d), 0)))/2);
A317937(n) = numerator(A317937aux(n));
(PARI)
\\ DirSqrt(v) finds u such that v = v[1]*dirmul(u, u).
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}
apply(numerator, DirSqrt(vector(100, n, if(1==n, 1, omega(n))))) \\ Andrew Howroyd, Aug 13 2018
CROSSREFS
KEYWORD
sign,frac
AUTHOR
Antti Karttunen, Aug 12 2018
STATUS
approved