OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
László Tóth, Alternating Sums Concerning Multiplicative Arithmetic Functions, Journal of Integer Sequences, Vol. 20 (2017), Article 17.2.1.
FORMULA
a(n) = Sum_{k=1..n} (-1)^(k+1) * A206369(k).
a(n) = (Pi^2/120) * n^2 + O(n * log(n)^(2/3) * log(log(n))^(4/3)) (Tóth, 2017).
MATHEMATICA
f[p_, e_] := Sum[(-1)^(e-k)*p^k, {k, 0, e}]; beta[1] = 1; beta[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[(-1)^(# + 1) * beta[#] &, 100]]
PROG
(PARI) beta(n) = {my(f = factor(n)); prod(i=1, #f~, p = f[i, 1]; e = f[i, 2]; sum(k = 0, e, (-1)^(e-k)*p^k)); }
lista(kmax) = {my(s = 0); for(k = 1, kmax, s += (-1)^(k+1) * beta(k); print1(s, ", "))};
(Python)
from math import prod
from sympy import factorint
def A370906(n): return sum((1 if k&1 else -1)*prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1), p+1)) for p, e in factorint(k).items()) for k in range(1, n+1)) # Chai Wah Wu, Mar 05 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Amiram Eldar, Mar 05 2024
STATUS
approved