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-4 of 4 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

A078471 Sum of all odd divisors of all positive integers <= n.

Original entry on oeis.org

1, 2, 6, 7, 13, 17, 25, 26, 39, 45, 57, 61, 75, 83, 107, 108, 126, 139, 159, 165, 197, 209, 233, 237, 268, 282, 322, 330, 360, 384, 416, 417, 465, 483, 531, 544, 582, 602, 658, 664, 706, 738, 782, 794, 872, 896, 944, 948, 1005, 1036, 1108, 1122, 1176, 1216
Offset: 1

Views

Author

Benoit Cloitre, Dec 31 2002

Keywords

Comments

The subsequence of primes begins: 2, 7, 13, 17, 61, 83, 107, 139, 197, 233, then no more through a(54). [Jonathan Vos Post, Feb 14 2010]
a(n) is also the total number of parts in all partitions of all positive integers <= n into an odd number of equal parts. - Omar E. Pol, Jun 04 2017

Crossrefs

Partial sums of A000593.

Programs

  • Magma
    [&+[&+[d:d in Divisors(k)|IsOdd(d)]:k in [1..n]]:n in [1..60]]; // Marius A. Burtea, Aug 28 2019
    
  • Maple
    with(numtheory):
    b:= n-> add(d, d=select(x-> x::odd, divisors(n))):
    a:= proc(n) option remember; b(n)+`if`(n=1, 0, a(n-1)) end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    a[n_] := Sum[DivisorSum[k, (-1)^(# + 1) k/# &], {k, 1, n}]; Array[a, 60] (* Jean-François Alcover, Dec 07 2015 *)
    Accumulate[Table[Total[Select[Divisors[n],OddQ]],{n,60}]] (* Harvey P. Dale, Sep 15 2024 *)
  • PARI
    a(n)=sum(v=1,n,sumdiv(v,d,(-1)^(d+1)*v/d))
    
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, (d%2)*d)); \\ Michel Marcus, Apr 09 2016
    
  • Python
    def A078471(n): return sum(k*(n//k) for k in range((n>>1)+1, n+1)) + sum(k*(n//k-((n>>1)//k<<1)) for k in range(1, (n>>1)+1)) # Chai Wah Wu, Apr 26 2023
    
  • Python
    from math import isqrt
    def A078471(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))-((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) = Sum_{k=1..n} A000593(k).
a(n) is asymptotic to c*n^2 where c = Pi^2/24.
a(n) = A024916(n) - A271342(n). - Omar E. Pol, Apr 08 2016
G.f.: (1/(1 - x))*Sum_{k>=1} k*x^k/(1 + x^k). - Ilya Gutkovskiy, Dec 23 2016
From Ridouane Oudra, Aug 28 2019: (Start)
a(n) = Sum_{k=1..n} (sigma(2k) - 2*sigma(k)), where sigma = A000203.
a(n) = A326124(n) - 2*A024916(n). (End)

Extensions

Better definition from Omar E. Pol, Apr 09 2016

A066966 Total sum of even parts in all partitions of n.

Original entry on oeis.org

0, 2, 2, 10, 12, 30, 40, 82, 110, 190, 260, 422, 570, 860, 1160, 1690, 2252, 3170, 4190, 5760, 7540, 10142, 13164, 17450, 22442, 29300, 37410, 48282, 61170, 78132, 98310, 124444, 155582, 195310, 242722, 302570, 373882, 462954, 569130, 700570, 856970
Offset: 1

Views

Author

Vladeta Jovovic, Jan 26 2002

Keywords

Comments

Partial sums of A206436. - Omar E. Pol, Mar 17 2012
From Omar E. Pol, Apr 02 2023: (Start)
Convolution of A000041 and A146076.
Convolution of A002865 and A271342.
a(n) is also the sum of all even divisors of all positive integers in a sequence with n blocks where the m-th block consists of A000041(n-m) copies of m, with 1 <= m <= n. The mentioned even divisors are also all even parts of all partitions of n. (End)

Examples

			a(4) = 10 because in the partitions of 4, namely [4],[3,1],[2,2],[2,1,1],[1,1,1,1], the total sum of the even parts is 4+2+2+2 = 10.
		

Crossrefs

Programs

  • Maple
    g:=sum(2*j*x^(2*j)/(1-x^(2*j)),j=1..55)/product(1-x^j,j=1..55): gser:=series(g,x=0,45): seq(coeff(gser,x^n),n=1..41);
    # Emeric Deutsch, Feb 20 2006
    b:= proc(n, i) option remember; local f, g;
          if n=0 or i=1 then [1, 0]
        else f:= b(n, i-1); g:= `if`(i>n, [0, 0], b(n-i, i));
             [f[1]+g[1], f[2]+g[2]+ ((i+1) mod 2)*g[1]*i]
          fi
        end:
    a:= n-> b(n, n)[2]:
    seq(a(n), n=1..50);
    # Alois P. Heinz, Mar 22 2012
  • Mathematica
    max = 50; g = Sum[2*j*x^(2*j)/(1 - x^(2*j)), {j, 1, max}]/Product[1 - x^j, {j, 1, max}]; gser = Series[g, {x, 0, max}]; a[n_] := SeriesCoefficient[gser, {x, 0, n}]; Table[a[n], {n, 1, max - 1}] (* Jean-François Alcover, Jan 24 2014, after Emeric Deutsch *)
    Map[Total[Select[Flatten[IntegerPartitions[#]], EvenQ]] &, Range[30]] (* Peter J. C. Moses, Mar 14 2014 *)
  • PARI
    a(n) = 2*sum(k=1, floor(n/2), sigma(k)*numbpart(n-2*k) ); \\ Joerg Arndt, Jan 24 2014

Formula

a(n) = 2*Sum_{k=1..floor(n/2)} sigma(k)*numbpart(n-2*k).
a(n) = Sum_{k=0..n} k*A113686(n,k). - Emeric Deutsch, Feb 20 2006
G.f.: Sum_{j>=1} (2jx^(2j)/(1-x^(2j)))/Product_{j>=1}(1-x^j). - Emeric Deutsch, Feb 20 2006
a(n) = A066186(n) - A066967(n). - Omar E. Pol, Mar 10 2012
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*sqrt(3)). - Vaclav Kotesovec, May 29 2018

Extensions

More terms from Naohiro Nomoto and Sascha Kurz, Feb 07 2002
More terms from Emeric Deutsch, Feb 20 2006

A362059 Total number of even divisors of all positive integers <= n.

Original entry on oeis.org

0, 1, 1, 3, 3, 5, 5, 8, 8, 10, 10, 14, 14, 16, 16, 20, 20, 23, 23, 27, 27, 29, 29, 35, 35, 37, 37, 41, 41, 45, 45, 50, 50, 52, 52, 58, 58, 60, 60, 66, 66, 70, 70, 74, 74, 76, 76, 84, 84, 87, 87, 91, 91, 95, 95, 101, 101, 103, 103, 111, 111, 113, 113, 119, 119, 123, 123, 127, 127, 131, 131, 140, 140, 142, 142, 146
Offset: 1

Views

Author

Omar E. Pol, Apr 06 2023

Keywords

Comments

Convolved with A002865 gives A066898.

Crossrefs

Partial sums of A183063.

Programs

  • Mathematica
    d[n_] := (e = IntegerExponent[n, 2]) * DivisorSigma[0, n/2^e]; Accumulate@ Array[d, 100] (* Amiram Eldar, Apr 07 2023 *)
  • Python
    from math import isqrt
    def A362059(n): return -(q:=isqrt(m:=n>>1))**2+(sum(m//k for k in range(1, q+1))<<1) # Chai Wah Wu, Apr 26 2023

Formula

a(2n-1) = A006218(n-1), n >= 1.
a(2n) = A006218(n), n >= 1.
Showing 1-4 of 4 results.