login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 96
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

Row sums of triangle A130541. E.g., a(5) = 15 = (10 + 3 + 1 + 1), sum of row 4 terms of triangle A130541. - Gary W. Adamson, Jun 03 2007

Row sums of triangle A134867. - Gary W. Adamson, Nov 14 2007

a(10^4) = 82256014, a(10^5) = 8224740835, a(10^6) = 822468118437, a(10^7) = 82246711794796; see A072692. - M. F. Hasler, Nov 22 2007

Equals row sums of triangle A158905. - Gary W. Adamson, Mar 29 2009

n is prime if and only if a(n) - a(n-1) - 1 =  n. - Omar E. Pol, Dec 31 2012

Also the alternating row sums of A236104. - Omar E. Pol, Jul 21 2014

REFERENCES

Hardy and Wright, "An introduction to the theory of numbers", Oxford University Press, fifth edition, p. 266.

LINKS

Daniel Mondot, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)

P. L. Patodia (pannalal(AT)usa.net), PARI program for A072692 and A024916

Peter Polm, C# program for A024916

A. Walfisz, Weylsche Exponentialsummen in der neueren Zahlentheorie, ZAMM - Journal of Applied Mathematics and Mechanics / Zeitschrift für Angewandte Mathematik und Mechanik, Volume 44, Issue 12, page 607, 1964.

FORMULA

a(n) = n^2 - A004125(n); asymptotically a(n) = n^2*Pi^2/12+O(n*Log(n)). - Benoit Cloitre, Apr 28 2002

G.f.: 1/(1-x)*sum(k>=1, x^k/(1-x^k)^2). - Benoit Cloitre, Apr 23 2003

a(n) = sum_{m=1..n} n - (n mod m). - Roger L. Bagula and Gary W. Adamson, Oct 06 2006

a(n) = n^2*Pi^2/12 + O(n*log(n)^(2/3)) [Walfisz]. - Charles R Greathouse IV, Jun 19 2012

a(n) = A000217(n) + A153485(n). - Omar E. Pol, Jan 28 2014

a(n) = A000292(n) - A076664(n), n > 0. - Omar E. Pol, Feb 11 2014

a(n) = A078471(n) + A271342(n). - Omar E. Pol, Apr 08 2016

MAPLE

with(numtheory): seq(add(sigma(k), k=0..n), n=1..49); # Zerinvary Lajos, Jan 11 2009

MATHEMATICA

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 *)

PROG

(PARI) A024916(n)=sum(k=1, n, n\k*k) \\ M. F. Hasler, Nov 22 2007

(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]

-- Reinhard Zumkeller, Apr 20 2015

CROSSREFS

Cf. A056550, A104471(2*n-1, n), A123229, A130541, A000217, A134867, A072692, A158905.

Sequence in context: A071422 A212538 A113902 * A212539 A102216 A001182

Adjacent sequences:  A024913 A024914 A024915 * A024917 A024918 A024919

KEYWORD

nonn,nice

AUTHOR

Clark Kimberling

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 30 18:30 EDT 2017. Contains 284302 sequences.