|
|
A024916
|
|
a(n) = Sum_{k=1..n} k*floor(n/k); also Sum_{k=1..n} sigma(k) where sigma(n) = sum of divisors of n (A000203).
|
|
211
|
|
|
1, 4, 8, 15, 21, 33, 41, 56, 69, 87, 99, 127, 141, 165, 189, 220, 238, 277, 297, 339, 371, 407, 431, 491, 522, 564, 604, 660, 690, 762, 794, 857, 905, 959, 1007, 1098, 1136, 1196, 1252, 1342, 1384, 1480, 1524, 1608, 1686, 1758, 1806, 1930, 1987, 2080, 2152
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
a(10^4) = 82256014, a(10^5) = 8224740835, a(10^6) = 822468118437, a(10^7) = 82246711794796; see A072692. - M. F. Hasler, Nov 22 2007
n is prime if and only if a(n) - a(n-1) - 1 = n. - Omar E. Pol, Dec 31 2012
a(n) is also the total number of parts in all partitions of the positive integers <= n into equal parts. - Omar E. Pol, Apr 30 2017
a(n) is also the total area of the terraces of the stepped pyramid with n levels described in A245092. - Omar E. Pol, Nov 04 2017
a(n) is also the area under the Dyck path described in the n-th row of A237593 (see example). - Omar E. Pol, Sep 17 2018
a(n) is also the number of cubic cells (or cubes) in the n-th level starting from the top of the stepped pyramid described in A245092. - Omar E. Pol, Jan 12 2022
|
|
REFERENCES
|
Hardy and Wright, "An introduction to the theory of numbers", Oxford University Press, fifth edition, p. 266.
|
|
LINKS
|
|
|
FORMULA
|
Asymptotically a(n) = n^2*Pi^2/12 + O(n*log(n)). (End)
G.f.: (1/(1-x))*Sum_{k>=1} x^k/(1-x^k)^2. - Benoit Cloitre, Apr 23 2003
|
|
EXAMPLE
|
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)
|
|
MAPLE
|
add(numtheory[sigma](k), k=0..n) ;
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 0,
numtheory[sigma](n)+a(n-1))
end:
|
|
MATHEMATICA
|
Table[Plus @@ Flatten[Divisors[Range[n]]], {n, 50}] (* Alonso del Arte, Mar 06 2006 *)
Accumulate[DivisorSigma[1, Range[60]]] (* Harvey P. Dale, Mar 13 2014 *)
|
|
PROG
|
(PARI) 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
(PARI) A024916(n)={my(s=0, d=1, q=n); while(d<q, s+=q*(q+1+2*d)\2; d++; q=n\d; ); return(s-d*(d-1)\2*d+q*(q+1)\2); } \\ Peter Polm, Aug 18 2014
(PARI) 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.
(Haskell)
a024916 n = sum $ map (\k -> k * div n k) [1..n]
(Magma) [(&+[DivisorSigma(1, k): k in [1..n]]): n in [1..60]]; // G. C. Greubel, Mar 15 2019
(Sage) [sum(sigma(k) for k in (1..n)) for n in (1..60)] # G. C. Greubel, Mar 15 2019
(Python)
|
|
CROSSREFS
|
Cf. A056550, A104471(2*n-1, n), A123229, A128489, A000217, A134867, A072692, A158905, A237593, A245092, A006218, A222548, A092406, A160664.
|
|
KEYWORD
|
nonn,nice
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|