A130541 Duplicate of A128489.
1, 3, 1, 6, 1, 1, 10, 3, 1, 1, 15, 3, 1, 1, 1, 21, 6, 3, 1, 1, 1, 28, 6, 3, 1, 1, 1, 1, 36, 10, 3, 3, 1, 1, 1, 1, 45, 10, 6, 3, 1, 1, 1, 1, 1
Offset: 1
Keywords
Crossrefs
Cf. A128489.
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.
From _Omar E. Pol_, Aug 20 2021: (Start) For n = 6 the sum of all divisors of the first six positive integers is [1] + [1 + 2] + [1 + 3] + [1 + 2 + 4] + [1 + 5] + [1 + 2 + 3 + 6] = 1 + 3 + 4 + 7 + 6 + 12 = 33, so a(6) = 33. On the other hand the area under the Dyck path of the 6th diagram as shown below is equal to 33, so a(6) = 33. Illustration of initial terms: _ _ _ _ _ _ _ | |_ _ _ _ | | | |_ _ _ | |_ | |_ _ | | _ _ | |_ | | | | | | _ | | | | | | | | | | |_| |_ _| |_ _ _| |_ _ _ _| |_ _ _ _ _| |_ _ _ _ _ _| . 1 4 8 15 21 33 (End)
a024916 n = sum $ map (\k -> k * div n k) [1..n] -- Reinhard Zumkeller, Apr 20 2015
[(&+[DivisorSigma(1, k): k in [1..n]]): n in [1..60]]; // G. C. Greubel, Mar 15 2019
A024916 := proc(n) add(numtheory[sigma](k),k=0..n) ; end proc: # Zerinvary Lajos, Jan 11 2009 # second Maple program: a:= proc(n) option remember; `if`(n=0, 0, numtheory[sigma](n)+a(n-1)) end: seq(a(n), n=1..100); # Alois P. Heinz, Sep 12 2019
Table[Plus @@ Flatten[Divisors[Range[n]]], {n, 50}] (* Alonso del Arte, Mar 06 2006 *) Table[Sum[n - Mod[n, m], {m, n}], {n, 50}] (* Roger L. Bagula and Gary W. Adamson, Oct 06 2006 *) a[n_] := Sum[DivisorSigma[1, k], {k, n}]; Table[a[n], {n, 51}] (* Jean-François Alcover, Dec 16 2011 *) Accumulate[DivisorSigma[1,Range[60]]] (* Harvey P. Dale, Mar 13 2014 *)
A024916(n)=sum(k=1,n,n\k*k) \\ M. F. Hasler, Nov 22 2007
A024916(z) = { my(s,u,d,n,a,p); s = z*z; u = sqrtint(z); p = 2; for(d=1, u, n = z\d - z\(d+1); if(n<=1, p=d; break(), a = z%d; s -= (2*a+(n-1)*d)*n/2); ); u = z\p; for(d=2, u, s -= z%d); return(s); } \\ See the link for a nicely formatted version. - P. L. Patodia (pannalal(AT)usa.net), Jan 11 2008
A024916(n)={my(s=0,d=1,q=n);while(dPeter Polm, Aug 18 2014
A024916(n)={ my(s=n^2, r=sqrtint(n), nd=n, D); for(d=1, r, (1>=D=nd-nd=n\(d+1)) && (r=d-1) && break; s -= n%d*D+(D-1)*D\2*d); s - sum(d=2, n\(r+1), n%d)} \\ Slightly optimized version of Patodia's code. - M. F. Hasler, Apr 18 2015 (C#) See Polm link.
def A024916(n): return sum(k*(n//k) for k in range(1,n+1)) # Chai Wah Wu, Dec 17 2021
from math import isqrt def A024916(n): return (-(s:=isqrt(n))**2*(s+1) + sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1)))>>1 # Chai Wah Wu, Oct 21 2023
[sum(sigma(k) for k in (1..n)) for n in (1..60)] # G. C. Greubel, Mar 15 2019
Comments