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.

A024917 a(n) = Sum_{k=2..n} k*floor(n/k).

Original entry on oeis.org

2, 5, 11, 16, 27, 34, 48, 60, 77, 88, 115, 128, 151, 174, 204, 221, 259, 278, 319, 350, 385, 408, 467, 497, 538, 577, 632, 661, 732, 763, 825, 872, 925, 972, 1062, 1099, 1158, 1213, 1302, 1343, 1438, 1481, 1564, 1641, 1712, 1759, 1882, 1938, 2030, 2101, 2198, 2251
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[k*Floor(n/k): k in [2..n]]: n in [2..55]]; // Bruno Berselli, Jan 08 2012
    
  • Mathematica
    Table[Sum[k*Floor[n/k],{k,2,n}],{n,2,60}] (* Harvey P. Dale, Mar 13 2015 *)
  • PARI
    a(n) = sum(k=2,n, k*floor(n/k)); \\ Michel Marcus, Sep 02 2019
    
  • Python
    from math import isqrt
    def A024917(n): return (-(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1)-n # Chai Wah Wu, Oct 23 2023

Formula

G.f.: (1/(1 - x)) * Sum_{k>=2} k*x^k/(1 - x^k). - Ilya Gutkovskiy, Sep 02 2019