cp's OEIS Frontend

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.

Showing 1-8 of 8 results.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

Row sums of triangle A128489. E.g., a(5) = 15 = (10 + 3 + 1 + 1), sum of row 4 terms of triangle A128489. - 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
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
From Omar E. Pol, Feb 17 2020: (Start)
Convolution of A340793 and A000027.
Convolved with A340793 gives A000385. (End)
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

Examples

			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)
		

References

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

Crossrefs

Programs

  • Haskell
    a024916 n = sum $ map (\k -> k * div n k) [1..n]
    -- Reinhard Zumkeller, Apr 20 2015
    
  • Magma
    [(&+[DivisorSigma(1, k): k in [1..n]]): n in [1..60]]; // G. C. Greubel, Mar 15 2019
    
  • Maple
    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
  • 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 *)
  • 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(dPeter 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.
    
  • Python
    def A024916(n): return sum(k*(n//k) for k in range(1,n+1)) # Chai Wah Wu, Dec 17 2021
    
  • Python
    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
  • Sage
    [sum(sigma(k) for k in (1..n)) for n in (1..60)] # G. C. Greubel, Mar 15 2019
    

Formula

From Benoit Cloitre, Apr 28 2002: (Start)
a(n) = n^2 - A004125(n).
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
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
a(n) = (1/2)*(A222548(n) + A006218(n)). - Ridouane Oudra, Aug 03 2019
From Greg Dresden, Feb 23 2020: (Start)
a(n) = A092406(n) + 8, n>3.
a(n) = A160664(n) - 1, n>0. (End)
a(2*n) = A326123(n) + A326124(n). - Vaclav Kotesovec, Aug 18 2021
a(n) = Sum_{k=1..n} k * A010766(n,k). - Georg Fischer, Mar 04 2022

A326124 a(n) is the sum of all divisors of the first n positive even numbers.

Original entry on oeis.org

3, 10, 22, 37, 55, 83, 107, 138, 177, 219, 255, 315, 357, 413, 485, 548, 602, 693, 753, 843, 939, 1023, 1095, 1219, 1312, 1410, 1530, 1650, 1740, 1908, 2004, 2131, 2275, 2401, 2545, 2740, 2854, 2994, 3162, 3348, 3474, 3698, 3830, 4010, 4244, 4412, 4556, 4808, 4979, 5196, 5412, 5622, 5784, 6064, 6280
Offset: 1

Views

Author

Omar E. Pol, Jun 07 2019

Keywords

Comments

A326123(n)/a(n) converges to 3/5.
a(n) is also the total area of the terraces of the first n even-indexed levels of the stepped pyramid described in A245092.

Examples

			For n = 3 the first three positive even numbers are [2, 4, 6] and their divisors are [1, 2], [1, 2, 4], [1, 2, 3, 6] respectively, and the sum of these divisors is 1 + 2 + 1 + 2 + 4 + 1 + 2 + 3 + 6 = 22, so a(3) = 22.
		

Crossrefs

Programs

  • Maple
    ListTools:-PartialSums(map(numtheory:-sigma, [seq(i,i=2..200,2)])); # Robert Israel, Jun 12 2019
  • Mathematica
    Accumulate@ DivisorSigma[1, Range[2, 110, 2]] (* Michael De Vlieger, Jun 09 2019 *)
  • PARI
    terms(n) = my(s=0, i=0); for(k=1, n-1, if(i>=n, break); s+=sigma(2*k); 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, if (!(k%2), sigma(k))); \\ Michel Marcus, Jun 08 2019
    
  • Python
    from math import isqrt
    def A326124(n): return (t:=isqrt(m:=n>>1))**2*(t+1) - sum((q:=m//k)*((k<<1)+q+1) for k in range(1,t+1))-3*((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

Formula

a(n) = A024916(2n) - A326123(n).
a(n) ~ 5 * Pi^2 * n^2 / 24. - Vaclav Kotesovec, Aug 18 2021

A067435 a(n) is the sum of all the remainders when n-th odd number is divided by odd numbers < 2n-1.

Original entry on oeis.org

0, 0, 2, 3, 6, 9, 16, 13, 27, 31, 34, 43, 57, 56, 75, 80, 96, 99, 121, 122, 155, 164, 163, 184, 220, 218, 255, 252, 277, 304, 339, 328, 372, 389, 412, 433, 491, 478, 515, 536, 570, 609, 638, 647, 722, 713, 746, 767, 858, 842, 910, 939, 942, 993, 1060, 1057
Offset: 1

Views

Author

Amarnath Murthy, Jan 29 2002

Keywords

Examples

			a(7) = 16 = 1 +3 +6 +4 +2 = 13 % 3 + 13 % 5 + 13 % 7 + 13 % 9 + 13 % 11.
		

Crossrefs

Programs

  • Maple
    L:= [seq(4*n-3 - numtheory:-sigma(2*n-1)-numtheory:-sigma((n-1)/2^padic:-ordp(n-1,2)), n=1..100)]:
    ListTools:-PartialSums(L); # Robert Israel, Jan 16 2019
  • Python
    from math import isqrt
    def A327329(n): return -(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))
    def A067435(n): return n*((n<<1)-1)-(A327329(n<<1)>>1)-A327329(n>>1)+3*(A327329(n)>>1)+A327329(n-1>>1)-(A327329(n-1)>>1) # Chai Wah Wu, Nov 01 2023

Formula

a(n) = a(n-1) + 4*n-3 - A000203(2*n-1) - A000593(n-1). - Robert Israel, Jan 16 2019
a(n) = n*(2*n-1) - A326123(n) - A078471(n-1) = n*(2*n-1) - A024916(2*n) - 2*A024916(floor(n/2)) + 3*A024916(n) + 2*A024916(floor((n-1)/2)) - A024916(n-1). - Chai Wah Wu, Nov 01 2023

Extensions

Corrected and extended by several contributors.

A346869 Sum of all divisors, except the smallest and the largest of every number, of the first n odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 3, 3, 3, 11, 11, 11, 21, 21, 26, 38, 38, 38, 52, 64, 64, 80, 80, 80, 112, 112, 119, 139, 139, 155, 177, 177, 177, 217, 235, 235, 261, 261, 261, 309, 327, 327, 366, 366, 388, 420, 420, 440, 474, 498, 498, 554, 554, 554, 640, 640, 640, 680, 680, 708, 772, 796
Offset: 1

Views

Author

Omar E. Pol, Aug 18 2021

Keywords

Comments

Partial sums of the odd-indexed terms of Chowla's function A048050.
a(n) has a symmetric representation.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 0,
          a(n-1)+numtheory[sigma](2*n-1)-2*n)
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Aug 19 2021
  • Mathematica
    s[1] = 0; s[n_] := DivisorSigma[1, 2*n - 1] - 2*n; Accumulate @ Array[s, 50] (* Amiram Eldar, Aug 19 2021 *)
    Accumulate[Join[{0},Table[DivisorSigma[1,n]-n-1,{n,3,151,2}]]] (* Harvey P. Dale, Jul 29 2023 *)
  • Python
    from sympy import divisors
    from itertools import accumulate
    def A346879(n): return sum(divisors(2*n-1)[1:-1])
    def aupton(nn): return list(accumulate(A346879(n) for n in range(1, nn+1)))
    print(aupton(60)) # Michael S. Branicky, Aug 19 2021

A346879 Sum of the divisors, except the smallest and the largest, of the n-th odd number.

Original entry on oeis.org

0, 0, 0, 0, 3, 0, 0, 8, 0, 0, 10, 0, 5, 12, 0, 0, 14, 12, 0, 16, 0, 0, 32, 0, 7, 20, 0, 16, 22, 0, 0, 40, 18, 0, 26, 0, 0, 48, 18, 0, 39, 0, 22, 32, 0, 20, 34, 24, 0, 56, 0, 0, 86, 0, 0, 40, 0, 28, 64, 24, 11, 44, 30, 0, 46, 0, 26, 104, 0, 0, 50, 24, 34, 80, 0, 0, 80, 36
Offset: 1

Views

Author

Omar E. Pol, Aug 18 2021

Keywords

Comments

a(n) has a symmetric representation.

Examples

			For n = 5 the 5th odd number is 9 and the divisors of 9 are [1, 3, 9] and the sum of the divisors of 9 except the smaller and the largest is 3, so a(5) = 3.
For n = 6 the 6th odd number is 11 and the divisors of 11 are [1, 11] and the sum of the divisors of 11 except the smaller and the largest is 0, so a(6) = 0.
		

Crossrefs

Bisection of A048050.
Partial sums give A346869.

Programs

  • Mathematica
    a[1] = 0; a[n_] := DivisorSigma[1, 2*n - 1] - 2*n; Array[a, 100] (* Amiram Eldar, Aug 19 2021 *)
  • Python
    from sympy import divisors
    def a(n): return sum(divisors(2*n-1)[1:-1])
    print([a(n) for n in range(1, 79)]) # Michael S. Branicky, Aug 19 2021

Formula

a(n) = A048050(2*n-1).

A346877 Sum of the divisors, except for the largest, of the n-th odd number.

Original entry on oeis.org

0, 1, 1, 1, 4, 1, 1, 9, 1, 1, 11, 1, 6, 13, 1, 1, 15, 13, 1, 17, 1, 1, 33, 1, 8, 21, 1, 17, 23, 1, 1, 41, 19, 1, 27, 1, 1, 49, 19, 1, 40, 1, 23, 33, 1, 21, 35, 25, 1, 57, 1, 1, 87, 1, 1, 41, 1, 29, 65, 25, 12, 45, 31, 1, 47, 1, 27, 105, 1, 1, 51, 25, 35, 81, 1, 1, 81, 37
Offset: 1

Views

Author

Omar E. Pol, Aug 20 2021

Keywords

Comments

Sum of aliquot divisors (or aliquot parts) of the n-th odd number.
a(n) has a symmetric representation.

Examples

			For n = 5 the 5th odd number is 9 and the divisors of 9 are [1, 3, 9] and the sum of the divisors of 9 except for the largest is 1 + 3 = 4, so a(5) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSigma[1, 2*n - 1] - 2*n + 1; Array[a, 100] (* Amiram Eldar, Aug 20 2021 *)
    Total[Most[Divisors[#]]]&/@Range[1,161,2] (* Harvey P. Dale, Sep 29 2024 *)
  • PARI
    a(n) = sigma(2*n-1) - (2*n-1); \\ Michel Marcus, Aug 20 2021
  • Python
    from sympy import divisors
    def a(n): return sum(divisors(2*n-1)[:-1])
    print([a(n) for n in range(1, 79)]) # Michael S. Branicky, Aug 20 2021
    

Formula

a(n) = A001065(2*n-1).
a(n) = A057427(n-1) + A346879(n).
G.f.: Sum_{k>=0} (2*k + 1) * x^(3*k + 2) / (1 - x^(2*k + 1)). - Ilya Gutkovskiy, Aug 20 2021
Sum_{k=1..n} a(k) = (Pi^2/8 - 1)*n^2 + O(n*log(n)). - Amiram Eldar, Mar 17 2024

A347108 a(n) = Sum_{k=1..n} sigma(k)*sigma(2*k), where sigma(n) = A000203(n) is the sum of the divisors of n.

Original entry on oeis.org

3, 24, 72, 177, 285, 621, 813, 1278, 1785, 2541, 2973, 4653, 5241, 6585, 8313, 10266, 11238, 14787, 15987, 19767, 22839, 25863, 27591, 35031, 37914, 42030, 46830, 53550, 56250, 68346, 71418, 79419, 86331, 93135, 100047, 117792, 122124, 130524, 139932, 156672
Offset: 1

Views

Author

Vaclav Kotesovec, Aug 18 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[DivisorSigma[1,k] * DivisorSigma[1,2*k], {k, 1, 100}]]
  • PARI
    a(n) = sum(k=1, n, sigma(k)*sigma(2*k)); \\ Michel Marcus, Aug 18 2021

Formula

a(n) ~ 2*zeta(3)*n^3.

A347153 Sum of all divisors, except the largest of every number, of the first n odd numbers.

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 9, 18, 19, 20, 31, 32, 38, 51, 52, 53, 68, 81, 82, 99, 100, 101, 134, 135, 143, 164, 165, 182, 205, 206, 207, 248, 267, 268, 295, 296, 297, 346, 365, 366, 406, 407, 430, 463, 464, 485, 520, 545, 546, 603, 604, 605, 692, 693, 694, 735, 736, 765, 830, 855
Offset: 1

Views

Author

Omar E. Pol, Aug 20 2021

Keywords

Comments

Sum of all aliquot divisors (or aliquot parts) of the first n odd numbers.
Partial sums of the odd-indexed terms of A001065.
a(n) has a symmetric representation.

Crossrefs

Programs

  • Mathematica
    s[n_] := DivisorSigma[1, 2*n - 1] - 2*n + 1; Accumulate @ Array[s, 100] (* Amiram Eldar, Aug 20 2021 *)
  • PARI
    a(n) = sum(k=1, n, k = 2*k-1; sigma(k)-k); \\ Michel Marcus, Aug 20 2021
  • Python
    from sympy import divisors
    from itertools import accumulate
    def A346877(n): return sum(divisors(2*n-1)[:-1])
    def aupton(nn): return list(accumulate(A346877(n) for n in range(1, nn+1)))
    print(aupton(60)) # Michael S. Branicky, Aug 20 2021
    

Formula

a(n) = A001477(n-1) + A346869(n).
G.f.: (1/(1 - x)) * Sum_{k>=0} (2*k + 1) * x^(3*k + 2) / (1 - x^(2*k + 1)). - Ilya Gutkovskiy, Aug 20 2021
a(n) = (Pi^2/8 - 1)*n^2 + O(n*log(n)). - Amiram Eldar, Mar 21 2024
Showing 1-8 of 8 results.