OFFSET
1,3
LINKS
FORMULA
MATHEMATICA
f[p_, e_] := NextPrime[p]^e; s[1] = 0; s[n_] := Times @@ f @@@ FactorInteger[n] - n; a[1] = 1; a[n_] := a[n] = -DivisorSum[n, a[#] * s[n/#] &, # < n &]; Array[a, 100] (* Amiram Eldar, Nov 27 2021 *)
PROG
(PARI)
up_to = 16384;
A336853(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); (factorback(f)-n); };
Aux347098(n) = if(1==n, n, A336853(n));
DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(d<n, v[n/d]*u[d], 0)))); (u) }; \\ Compute the Dirichlet inverse of the sequence given in input vector v.
v347098 = DirInverseCorrect(vector(up_to, n, Aux347098(n)));
A347098(n) = v347098[n];
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Aug 19 2021
STATUS
approved