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.

A344820 a(n) = Sum_{k=1..n} floor(n/k) * (-n)^(k-1).

Original entry on oeis.org

1, 0, 9, -52, 520, -6636, 102984, -1864600, 38741463, -909081740, 23775986069, -685854111804, 21633935838489, -740800448012044, 27368368159530285, -1085102592823737200, 45957792326631241516, -2070863582899905915336, 98920982783031811482920, -4993219047619535240997780
Offset: 1

Views

Author

Seiichi Manyama, May 29 2021

Keywords

Crossrefs

Diagonal of A344824.
Sums of the form Sum_{k=1..n} q^(k-1)*floor(n/k): this sequence (q=-n), A344819 (q=-4), A344818 (q=-3), A344817 (q=-2), A059851 (q=-1), A006218 (q=1), A268235 (q=2), A344814 (q=3), A344815 (q=4), A344816 (q=5), A332533 (q=n).

Programs

  • Magma
    A344820:= func< n | (&+[Floor(n/k)*(-n)^(k-1): k in [1..n]]) >;
    [A344820(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Mathematica
    a[n_] := Sum[(-n)^(k - 1) * Quotient[n, k], {k, 1, n}]; Array[a, 20] (* Amiram Eldar, May 29 2021 *)
  • PARI
    a(n) = sum(k=1, n, n\k*(-n)^(k-1));
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (-n)^(d-1)));
    
  • SageMath
    def A344820(n): return sum((n//k)*(-n)^(k-1) for k in range(1,n+1))
    [A344820(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} (-n)^(d-1).
a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} x^k/(1 + n*x^k).
a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} (-n)^(k-1) * x^k/(1 - x^k).
a(n) ~ -(-1)^n * n^(n-1). - Vaclav Kotesovec, Jun 05 2021