cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A370906 Partial alternating sums of the alternating sum of divisors function (A206369).

Original entry on oeis.org

1, 0, 2, -1, 3, 1, 7, 2, 9, 5, 15, 9, 21, 15, 23, 12, 28, 21, 39, 27, 39, 29, 51, 41, 62, 50, 70, 52, 80, 72, 102, 81, 101, 85, 109, 88, 124, 106, 130, 110, 150, 138, 180, 150, 178, 156, 202, 180, 223, 202, 234, 198, 250, 230, 270, 240, 276, 248, 306, 282, 342
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2024

Keywords

Crossrefs

Similar sequences: A068762, A068773, A307704, A357817, A362028.

Programs

  • 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]]
  • 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

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).