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.

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

Original entry on oeis.org

1, 2, 4, 7, 11, 13, 19, 24, 31, 35, 45, 51, 63, 69, 77, 88, 104, 111, 129, 141, 153, 163, 185, 195, 216, 228, 248, 266, 294, 302, 332, 353, 373, 389, 413, 434, 470, 488, 512, 532, 572, 584, 626, 656, 684, 706, 752, 774, 817, 838, 870, 906, 958, 978, 1018, 1048
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2024

Keywords

Crossrefs

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[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 += beta(k); print1(s, ", "))};
    
  • PARI
    a(n) = sum(k=1, n, (-1)^bigomega(k) * (n\k) * (n\k+1))/2; \\ Daniel Suteu, May 11 2024
    
  • Python
    from math import prod
    from sympy import factorint
    def A370905(n): return sum(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} A206369(k).
a(n) = (Pi^2/30) * n^2 + O(n * log(n)^(2/3) * log(log(n))^(4/3)) (Tóth, 2013).
a(n) = (1/2) * Sum_{k=1..n} A008836(k) * floor(n/k) * floor(n/k + 1). - Daniel Suteu, May 11 2024