login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271342 Sum of all even divisors of all positive integers <= n. 5
0, 2, 2, 8, 8, 16, 16, 30, 30, 42, 42, 66, 66, 82, 82, 112, 112, 138, 138, 174, 174, 198, 198, 254, 254, 282, 282, 330, 330, 378, 378, 440, 440, 476, 476, 554, 554, 594, 594, 678, 678, 742, 742, 814, 814, 862, 862, 982, 982, 1044, 1044, 1128, 1128, 1208, 1208, 1320, 1320, 1380, 1380, 1524, 1524, 1588, 1588, 1714, 1714 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) is also the sum of all even divisors of all even positive integers <= n.
a(n) is also the total number of parts in all partitions of all positive integers <= n into an even number of equal parts. - Omar E. Pol, Jun 04 2017
The bisection of this sequence equals twice A024916 (see formulas). - Michel Marcus, Dec 14 2017
LINKS
FORMULA
a(1) = 0.
a(n) = 2*A024916((n-1)/2), if n is odd and n > 1.
a(n) = 2*A024916(n/2), if n is even.
a(n) = A024916(n) - A078471(n).
For n > 1, a(2*n + 1) = a(2*n). - David A. Corneth, Jun 06 2017
a(n) = c * n^2 + O(n*log(n)), where c = Pi^2/24 = 0.411233... (A222171). - Amiram Eldar, Nov 27 2023
EXAMPLE
For n = 6 the divisors of all positive integers <= 6 are [1], [1, 2], [1, 3], [1, 2, 4], [1, 5], [1, 2, 3, 6] and the even divisors of all positive integers <= 6 are [2], [2, 4], [2, 6], so a(6) = 2 + 2 + 4 + 2 + 6 = 16. On the other hand the sum of all the divisors of all positive integers <= 6/2 are [1] + [1 + 2] + [1 + 3] = A024916(3) = 8, so a(6) = 2*8 = 16.
For n = 10, (floor(10/2) = 5) numbers have divisor 2, (floor(10/4) = 2) numbers have divisor 4, ..., (floor(10/10) = 1) numbers have divisor 10. Therefore, a(10) = 5 * 2 + 2 * 4 + 1 * 6 + 1 * 8 + 1 * 10 = 42. - David A. Corneth, Jun 06 2017
MATHEMATICA
Accumulate@ Array[DivisorSum[#, # &, EvenQ] &, 65] (* Michael De Vlieger, Jun 06 2017 *)
PROG
(PARI) a(n) = sum(k=1, n, sumdiv(k, d, (1-d%2)*d)); \\ Michel Marcus, Jun 05 2017
(PARI) a(n) = 2 * sum(k=1, n\2, k*(n\(k<<1))) \\ David A. Corneth, Jun 06 2017
(Python)
def A271342(n): return sum(k*((n>>1)//k) for k in range(1, (n>>1)+1))<<1 # Chai Wah Wu, Apr 26 2023
(Python)
from math import isqrt
def A271342(n): return -(s:=isqrt(m:=n>>1))**2*(s+1) + sum((q:=m//k)*((k<<1)+q+1) for k in range(1, s+1)) # Chai Wah Wu, Oct 21 2023
CROSSREFS
Partial sums of A146076.
Sequence in context: A268342 A058524 A072576 * A060818 A082887 A137583
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Apr 08 2016
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 14:38 EDT 2024. Contains 371254 sequences. (Running on oeis4.)