A326123 a(n) is the sum of all divisors of the first n odd numbers.
1, 5, 11, 19, 32, 44, 58, 82, 100, 120, 152, 176, 207, 247, 277, 309, 357, 405, 443, 499, 541, 585, 663, 711, 768, 840, 894, 966, 1046, 1106, 1168, 1272, 1356, 1424, 1520, 1592, 1666, 1790, 1886, 1966, 2087, 2171, 2279, 2399, 2489, 2601, 2729, 2849, 2947, 3103, 3205, 3309, 3501, 3609, 3719
Offset: 1
Examples
For n = 3 the first three odd numbers are [1, 3, 5] and their divisors are [1], [1, 3], [1, 5] respectively, and the sum of these divisors is 1 + 1 + 3 + 1 + 5 = 11, so a(3) = 11.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
ListTools:-PartialSums(map(numtheory:-sigma, [seq(i,i=1..200,2)])); # Robert Israel, Jun 12 2019
-
Mathematica
Accumulate@ DivisorSigma[1, Range[1, 109, 2]] (* Michael De Vlieger, Jun 09 2019 *)
-
PARI
terms(n) = my(s=0, i=0); for(k=0, n-1, if(i>=n, break); s+=sigma(2*k+1); print1(s, ", "); i++) /* Print initial 50 terms as follows: */ terms(50) \\ Felix Fröhlich, Jun 08 2019
-
PARI
a(n) = sum(k=1, 2*n-1, if (k%2, sigma(k))); \\ Michel Marcus, Jun 08 2019
-
Python
from math import isqrt def A326123(n): return (-(s:=isqrt(r:=n<<1))**2*(s+1) + sum((q:=r//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) -(t:=isqrt(m:=n>>1))**2*(t+1)+sum((q:=m//k)*((k<<1)+q+1) for k in range(1,t+1))+3*((u:=isqrt(n))**2*(u+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1,u+1))>>1) # Chai Wah Wu, Nov 01 2023
Formula
a(n) ~ Pi^2 * n^2 / 8. - Vaclav Kotesovec, Aug 18 2021
Comments