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-10 of 31 results. Next

A001065 Sum of proper divisors (or aliquot parts) of n: sum of divisors of n that are less than n.

Original entry on oeis.org

0, 1, 1, 3, 1, 6, 1, 7, 4, 8, 1, 16, 1, 10, 9, 15, 1, 21, 1, 22, 11, 14, 1, 36, 6, 16, 13, 28, 1, 42, 1, 31, 15, 20, 13, 55, 1, 22, 17, 50, 1, 54, 1, 40, 33, 26, 1, 76, 8, 43, 21, 46, 1, 66, 17, 64, 23, 32, 1, 108, 1, 34, 41, 63, 19, 78, 1, 58, 27, 74, 1, 123, 1, 40, 49, 64, 19, 90, 1, 106
Offset: 1

Views

Author

Keywords

Comments

Also total number of parts in all partitions of n into equal parts that do not contain 1 as a part. - Omar E. Pol, Jan 16 2013
Related concepts: If a(n) < n, n is said to be deficient, if a(n) > n, n is abundant, and if a(n) = n, n is perfect. If there is a cycle of length 2, so that a(n) = b and a(b) = n, b and n are said to be amicable. If there is a longer cycle, the numbers in the cycle are said to be sociable. See examples. - Juhani Heino, Jul 17 2017
Sum of the smallest parts in the partitions of n into two parts such that the smallest part divides the largest. - Wesley Ivan Hurt, Dec 22 2017
a(n) is also the total number of parts congruent to 0 mod k in the partitions of k*n into equal parts that do not contain k as a part (the comment dated Jan 16 2013 is the case for k = 1). - Omar E. Pol, Nov 23 2019
Fixed points are in A000396. - Alois P. Heinz, Mar 10 2024

Examples

			x^2 + x^3 + 3*x^4 + x^5 + 6*x^6 + x^7 + 7*x^8 + 4*x^9 + 8*x^10 + x^11 + ...
For n = 44, sum of divisors of n = sigma(n) = 84; so a(44) = 84-44 = 40.
Related concepts: (Start)
From 1 to 17, all n are deficient, except 6 and 12 seen below. See A005100.
Abundant numbers: a(12) = 16, a(18) = 21. See A005101.
Perfect numbers: a(6) = 6, a(28) = 28. See A000396.
Amicable numbers: a(220) = 284, a(284) = 220. See A259180.
Sociable numbers: 12496 -> 14288 -> 15472 -> 14536 -> 14264 -> 12496. See A122726. (End)
For n = 10 the sum of the divisors of 10 that are less than 10 is 1 + 2 + 5 = 8. On the other hand, the partitions of 10 into equal parts that do not contain 1 as a part are [10], [5,5], [2,2,2,2,2], there are 8 parts, so a(10) = 8. - _Omar E. Pol_, Nov 24 2019
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
  • George E. Andrews, Number Theory. New York: Dover, 1994; Pages 1, 75-92; p. 92 #15: Sigma(n) / d(n) >= n^(1/2).
  • Carl Pomerance, The first function and its iterates, pp. 125-138 in Connections in Discrete Mathematics, ed. S. Butler et al., Cambridge, 2018.
  • H. J. J. te Riele, Perfect numbers and aliquot sequences, pp. 77-94 in J. van de Lune, ed., Studieweek "Getaltheorie en Computers", published by Math. Centrum, Amsterdam, Sept. 1980.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 91.

Crossrefs

Least inverse: A070015, A359132.
Values taken: A078923, values not taken: A005114.
Records: A034090, A034091.
First differences: A053246, partial sums: A153485.
a(n) = n - A033879(n) = n + A033880(n). - Omar E. Pol, Dec 30 2013
Row sums of A141846 and of A176891. - Gary W. Adamson, May 02 2010
Row sums of A176079. - Mats Granvik, May 20 2012
Alternating row sums of A231347. - Omar E. Pol, Jan 02 2014
a(n) = sum (A027751(n,k): k = 1..A000005(n)-1). - Reinhard Zumkeller, Apr 05 2013
For n > 1: a(n) = A240698(n,A000005(n)-1). - Reinhard Zumkeller, Apr 10 2014
A134675(n) = A007434(n) + a(n). - Conjectured by John Mason and proved by Max Alekseyev, Jan 07 2015
Cf. A037020 (primes), A053868, A053869 (odd and even terms).
Cf. A048138 (number of occurrences), A238895, A238896 (record values thereof).
Cf. A007956 (products of proper divisors).
Cf. A005100, A005101, A000396, A259180, A122726 (related concepts).

Programs

  • Haskell
    a001065 n = a000203 n - n  -- Reinhard Zumkeller, Sep 15 2011
    
  • Magma
    [SumOfDivisors(n)-n: n in [1..100]]; // Vincenzo Librandi, May 06 2015
    
  • Maple
    A001065 := proc(n)
        numtheory[sigma](n)-n ;
    end proc:
    seq( A001065(n),n=1..100) ;
  • Mathematica
    Table[ Plus @@ Select[ Divisors[ n ], #Zak Seidov, Sep 10 2009 *)
    Table[DivisorSigma[1, n] - n, {n, 1, 80}] (* Jean-François Alcover, Apr 25 2013 *)
    Array[Plus @@ Most@ Divisors@# &, 80] (* Robert G. Wilson v, Dec 24 2017 *)
  • MuPAD
    numlib::sigma(n)-n$ n=1..81 // Zerinvary Lajos, May 13 2008
    
  • PARI
    {a(n) = if( n==0, 0, sigma(n) - n)} /* Michael Somos, Sep 20 2011 */
    
  • Python
    from sympy import divisor_sigma
    def A001065(n): return divisor_sigma(n)-n # Chai Wah Wu, Nov 04 2022
    
  • Sage
    [sigma(n, 1)-n for n in range(1, 81)] # Stefano Spezia, Jul 14 2025

Formula

G.f.: Sum_{k>0} k * x^(2*k)/(1 - x^k). - Michael Somos, Jul 05 2006
a(n) = sigma(n) - n = A000203(n) - n. - Lekraj Beedassy, Jun 02 2005
a(n) = A155085(-n). - Michael Somos, Sep 20 2011
Equals inverse Mobius transform of A051953 = A051731 * A051953. Example: a(6) = 6 = (1, 1, 1, 0, 0, 1) dot (0, 1, 1, 2, 1, 4) = (0 + 1 + 1 + 0 + 0 + 4), where A051953 = (0, 1, 1, 2, 1, 4, 1, 4, 3, 6, 1, 8, ...) and (1, 1, 1, 0, 0, 1) = row 6 of A051731 where the 1's positions indicate the factors of 6. - Gary W. Adamson, Jul 11 2008
a(n) = A006128(n) - A220477(n) - n. - Omar E. Pol Jan 17 2013
a(n) = Sum_{i=1..floor(n/2)} i*(1-ceiling(frac(n/i))). - Wesley Ivan Hurt, Oct 25 2013
Dirichlet g.f.: zeta(s-1)*(zeta(s) - 1). - Ilya Gutkovskiy, Aug 07 2016
a(n) = 1 + A048050(n), n > 1. - R. J. Mathar, Mar 13 2018
Erdős (Elem. Math. 28 (1973), 83-86) shows that the density of even integers in the range of a(n) is strictly less than 1/2. The argument of Coppersmith (1987) shows that the range of a(n) has density at most 47/48 < 1. - N. J. A. Sloane, Dec 21 2019
G.f.: Sum_{k >= 2} x^k/(1 - x^k)^2. Cf. A296955. (This follows from the fact that if g(z) = Sum_{n >= 1} a(n)*z^n and f(z) = Sum_{n >= 1} a(n)*z^(N*n)/(1 - z^n) then f(z) = Sum_{k >= N} g(z^k), taking a(n) = n and N = 2.) - Peter Bala, Jan 13 2021
Faster converging g.f.: Sum_{n >= 1} q^(n*(n+1))*(n*q^(3*n+2) - (n + 1)*q^(2*n+1) - (n - 1)*q^(n+1) + n)/((1 - q^n)*(1 - q^(n+1))^2). (In equation 1 in Arndt, after combining the two n = 0 summands to get -t/(1 - t), apply the operator t*d/dt to the resulting equation and then set t = q and x = 1.) - Peter Bala, Jan 22 2021
a(n) = Sum_{d|n} d * (1 - [n = d]), where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Jan 28 2021
a(n) = Sum_{i=1..n} ((n-1) mod i) - (n mod i). [See also A176079.] - José de Jesús Camacho Medina, Feb 23 2021

A237270 Triangle read by rows in which row n lists the parts of the symmetric representation of sigma(n).

Original entry on oeis.org

1, 3, 2, 2, 7, 3, 3, 12, 4, 4, 15, 5, 3, 5, 9, 9, 6, 6, 28, 7, 7, 12, 12, 8, 8, 8, 31, 9, 9, 39, 10, 10, 42, 11, 5, 5, 11, 18, 18, 12, 12, 60, 13, 5, 13, 21, 21, 14, 6, 6, 14, 56, 15, 15, 72, 16, 16, 63, 17, 7, 7, 17, 27, 27, 18, 12, 18, 91, 19, 19, 30, 30, 20, 8, 8, 20, 90
Offset: 1

Views

Author

Omar E. Pol, Feb 19 2014

Keywords

Comments

T(n,k) is the number of cells in the k-th region of the n-th set of regions in a diagram of the symmetry of sigma(n), see example.
Row n is a palindromic composition of sigma(n).
Row sums give A000203.
Row n has length A237271(n).
In the row 2n-1 of triangle both the first term and the last term are equal to n.
If n is an odd prime then row n is [m, m], where m = (1 + n)/2.
The connection with A196020 is as follows: A196020 --> A236104 --> A235791 --> A237591 --> A237593 --> A239660 --> this sequence.
For the boundary segments in an octant see A237591.
For the boundary segments in a quadrant see A237593.
For the boundary segments in the spiral see also A239660.
For the parts in every quadrant of the spiral see A239931, A239932, A239933, A239934.
We can find the spiral on the terraces of the stepped pyramid described in A244050. - Omar E. Pol, Dec 07 2016
T(n,k) is also the area of the k-th terrace, from left to right, at the n-th level, starting from the top, of the stepped pyramid described in A245092 (see Links section). - Omar E. Pol, Aug 14 2018

Examples

			Illustration of the first 27 terms as regions (or parts) of a spiral constructed with the first 15.5 rows of A239660:
.
.                  _ _ _ _ _ _ _ _
.                 |  _ _ _ _ _ _ _|_ _ _ _ _ _ _ 7
.                 | |             |_ _ _ _ _ _ _|
.             12 _| |                           |
.               |_ _|  _ _ _ _ _ _              |_ _
.         12 _ _|     |  _ _ _ _ _|_ _ _ _ _ 5      |_
.      _ _ _| |    9 _| |         |_ _ _ _ _|         |
.     |  _ _ _|  9 _|_ _|                   |_ _ 3    |_ _ _ 7
.     | |      _ _| |      _ _ _ _          |_  |         | |
.     | |     |  _ _| 12 _|  _ _ _|_ _ _ 3    |_|_ _ 5    | |
.     | |     | |      _|   |     |_ _ _|         | |     | |
.     | |     | |     |  _ _|           |_ _ 3    | |     | |
.     | |     | |     | |    3 _ _        | |     | |     | |
.     | |     | |     | |     |  _|_ 1    | |     | |     | |
.    _|_|    _|_|    _|_|    _|_| |_|    _|_|    _|_|    _|_|    _
.   | |     | |     | |     | |         | |     | |     | |     | |
.   | |     | |     | |     |_|_ _     _| |     | |     | |     | |
.   | |     | |     | |    2  |_ _|_ _|  _|     | |     | |     | |
.   | |     | |     |_|_     2    |_ _ _|7   _ _| |     | |     | |
.   | |     | |    4    |_                 _|  _ _|     | |     | |
.   | |     |_|_ _        |_ _ _ _        |  _|    _ _ _| |     | |
.   | |    6      |_      |_ _ _ _|_ _ _ _| | 15 _|    _ _|     | |
.   |_|_ _ _        |_   4        |_ _ _ _ _|  _|     |    _ _ _| |
.  8      | |_ _      |                       |      _|   |  _ _ _|
.         |_    |     |_ _ _ _ _ _            |  _ _|28  _| |
.           |_  |_    |_ _ _ _ _ _|_ _ _ _ _ _| |      _|  _|
.          8  |_ _|  6            |_ _ _ _ _ _ _|  _ _|  _|
.                 |                               |  _ _|  31
.                 |_ _ _ _ _ _ _ _                | |
.                 |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _| |
.                8                |_ _ _ _ _ _ _ _ _|
.
.
[For two other drawings of the spiral see the links. - _N. J. A. Sloane_, Nov 16 2020]
If the sequence does not contain negative terms then its terms can be represented in a quadrant. For the construction of the diagram we use the symmetric Dyck paths of A237593 as shown below:
---------------------------------------------------------------
Triangle         Diagram of the symmetry of sigma (n = 1..24)
---------------------------------------------------------------
.              _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1;            |_| | | | | | | | | | | | | | | | | | | | | | | |
3;            |_ _|_| | | | | | | | | | | | | | | | | | | | | |
2, 2;         |_ _|  _|_| | | | | | | | | | | | | | | | | | | |
7;            |_ _ _|    _|_| | | | | | | | | | | | | | | | | |
3, 3;         |_ _ _|  _|  _ _|_| | | | | | | | | | | | | | | |
12;           |_ _ _ _|  _| |  _ _|_| | | | | | | | | | | | | |
4, 4;         |_ _ _ _| |_ _|_|    _ _|_| | | | | | | | | | | |
15;           |_ _ _ _ _|  _|     |  _ _ _|_| | | | | | | | | |
5, 3, 5;      |_ _ _ _ _| |      _|_| |  _ _ _|_| | | | | | | |
9, 9;         |_ _ _ _ _ _|  _ _|    _| |    _ _ _|_| | | | | |
6, 6;         |_ _ _ _ _ _| |  _|  _|  _|   |  _ _ _ _|_| | | |
28;           |_ _ _ _ _ _ _| |_ _|  _|  _ _| | |  _ _ _ _|_| |
7, 7;         |_ _ _ _ _ _ _| |  _ _|  _|    _| | |    _ _ _ _|
12, 12;       |_ _ _ _ _ _ _ _| |     |     |  _|_|   |* * * *
8, 8, 8;      |_ _ _ _ _ _ _ _| |  _ _|  _ _|_|       |* * * *
31;           |_ _ _ _ _ _ _ _ _| |  _ _|  _|      _ _|* * * *
9, 9;         |_ _ _ _ _ _ _ _ _| | |_ _ _|      _|* * * * * *
39;           |_ _ _ _ _ _ _ _ _ _| |  _ _|    _|* * * * * * *
10, 10;       |_ _ _ _ _ _ _ _ _ _| | |       |* * * * * * * *
42;           |_ _ _ _ _ _ _ _ _ _ _| |  _ _ _|* * * * * * * *
11, 5, 5, 11; |_ _ _ _ _ _ _ _ _ _ _| | |* * * * * * * * * * *
18, 18;       |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
12, 12;       |_ _ _ _ _ _ _ _ _ _ _ _| |* * * * * * * * * * *
60;           |_ _ _ _ _ _ _ _ _ _ _ _ _|* * * * * * * * * * *
...
The total number of cells in the first n set of symmetric regions of the diagram equals A024916(n), the sum of all divisors of all positive integers <= n, hence the total number of cells in the n-th set of symmetric regions of the diagram equals sigma(n) = A000203(n).
For n = 9 the 9th row of A237593 is [5, 2, 2, 2, 2, 5] and the 8th row of A237593 is [5, 2, 1, 1, 2, 5] therefore between both symmetric Dyck paths there are three regions (or parts) of sizes [5, 3, 5], so row 9 is [5, 3, 5].
The sum of divisors of 9 is 1 + 3 + 9 = A000203(9) = 13. On the other hand the sum of the parts of the symmetric representation of sigma(9) is 5 + 3 + 5 = 13, equaling the sum of divisors of 9.
For n = 24 the 24th row of A237593 is [13, 4, 3, 2, 1, 1, 1, 1, 2, 3, 4, 13] and the 23rd row of A237593 is [12, 5, 2, 2, 1, 1, 1, 1, 2, 2, 5, 12] therefore between both symmetric Dyck paths there are only one region (or part) of size 60, so row 24 is 60.
The sum of divisors of 24 is 1 + 2 + 3 + 4 + 6 + 8 + 12 + 24 = A000203(24) = 60. On the other hand the sum of the parts of the symmetric representation of sigma(24) is 60, equaling the sum of divisors of 24.
Note that the number of *'s in the diagram is 24^2 - A024916(24) = 576 - 491 = A004125(24) = 85.
From _Omar E. Pol_, Nov 22 2020: (Start)
Also consider the infinite double-staircases diagram defined in A335616 (see the theorem).
For n = 15 the diagram with first 15 levels looks like this:
.
Level                         "Double-staircases" diagram
.                                          _
1                                        _|1|_
2                                      _|1 _ 1|_
3                                    _|1  |1|  1|_
4                                  _|1   _| |_   1|_
5                                _|1    |1 _ 1|    1|_
6                              _|1     _| |1| |_     1|_
7                            _|1      |1  | |  1|      1|_
8                          _|1       _|  _| |_  |_       1|_
9                        _|1        |1  |1 _ 1|  1|        1|_
10                     _|1         _|   | |1| |   |_         1|_
11                   _|1          |1   _| | | |_   1|          1|_
12                 _|1           _|   |1  | |  1|   |_           1|_
13               _|1            |1    |  _| |_  |    1|            1|_
14             _|1             _|    _| |1 _ 1| |_    |_             1|_
15            |1              |1    |1  | |1| |  1|    1|              1|
.
Starting from A196020 and after the algorithm described in A280850 and A296508 applied to the above diagram we have a new diagram as shown below:
.
Level                             "Ziggurat" diagram
.                                          _
6                                         |1|
7                            _            | |            _
8                          _|1|          _| |_          |1|_
9                        _|1  |         |1   1|         |  1|_
10                     _|1    |         |     |         |    1|_
11                   _|1      |        _|     |_        |      1|_
12                 _|1        |       |1       1|       |        1|_
13               _|1          |       |         |       |          1|_
14             _|1            |      _|    _    |_      |            1|_
15            |1              |     |1    |1|    1|     |              1|
.
The 15th row
of A249351 :  [1,1,1,1,1,1,1,1,0,0,0,1,1,1,2,1,1,1,0,0,0,1,1,1,1,1,1,1,1]
The 15th row
of triangle:  [              8,            8,            8              ]
The 15th row
of A296508:   [              8,      7,    1,    0,      8              ]
The 15th row
of A280851    [              8,      7,    1,            8              ]
.
More generally, for n >= 1, it appears there is the same correspondence between the original diagram of the symmetric representation of sigma(n) and the "Ziggurat" diagram of n.
For the definition of subparts see A239387 and also A296508, A280851. (End)
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_] := Ceiling[(n + 1)/k - (k + 1)/2] (* from A235791 *)
    path[n_] := Module[{c = Floor[(Sqrt[8n + 1] - 1)/2], h, r, d, rd, k, p = {{0, n}}}, h = Map[T[n, #] - T[n, # + 1] &, Range[c]]; r = Join[h, Reverse[h]]; d = Flatten[Table[{{1, 0}, {0, -1}}, {c}], 1];
    rd = Transpose[{r, d}]; For[k = 1, k <= 2c, k++, p = Join[p, Map[Last[p] + rd[[k, 2]] * # &, Range[rd[[k, 1]]]]]]; p]
    segments[n_] := SplitBy[Map[Min, Drop[Drop[path[n], 1], -1] - path[n - 1]], # == 0 &]
    a237270[n_] := Select[Map[Apply[Plus, #] &, segments[n]], # != 0 &]
    Flatten[Map[a237270, Range[40]]] (* data *)
    (* Hartmut F. W. Hoft, Jun 23 2014 *)

Formula

T(n, k) = (A384149(n, k) + A384149(n, m+1-k))/2, where m = A237271(n) is the row length. (conjectured) - Peter Munn, Jun 01 2025

Extensions

Drawing of the spiral extended by Omar E. Pol, Nov 22 2020

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

A262626 Visible parts of the perspective view of the stepped pyramid whose structure essentially arises after the 90-degree-zig-zag folding of the isosceles triangle A237593.

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 2, 2, 2, 1, 1, 2, 7, 3, 1, 1, 3, 3, 3, 3, 2, 2, 3, 12, 4, 1, 1, 1, 1, 4, 4, 4, 4, 2, 1, 1, 2, 4, 15, 5, 2, 1, 1, 2, 5, 5, 3, 5, 5, 2, 2, 2, 2, 5, 9, 9, 6, 2, 1, 1, 1, 1, 2, 6, 6, 6, 6, 3, 1, 1, 1, 1, 3, 6, 28, 7, 2, 2, 1, 1, 2, 2, 7, 7, 7, 7, 3, 2, 1, 1, 2, 3, 7, 12, 12, 8, 3, 1, 2, 2, 1, 3, 8, 8, 8, 8, 8, 3, 2, 1, 1
Offset: 1

Views

Author

Omar E. Pol, Sep 26 2015

Keywords

Comments

Also the rows of both triangles A237270 and A237593 interleaved.
Also, irregular triangle read by rows in which T(n,k) is the area of the k-th region (from left to right in ascending diagonal) of the n-th symmetric set of regions (from the top to the bottom in descending diagonal) in the two-dimensional diagram of the perspective view of the infinite stepped pyramid described in A245092 (see the diagram in the Links section).
The diagram of the symmetric representation of sigma is also the top view of the pyramid, see Links section. For more information about the diagram see also A237593 and A237270.
The number of cubes at the n-th level is also A024916(n), the sum of all divisors of all positive integers <= n.
Note that this pyramid is also a quarter of the pyramid described in A244050. Both pyramids have infinitely many levels.
Odd-indexed rows are also the rows of the irregular triangle A237270.
Even-indexed rows are also the rows of the triangle A237593.
Lengths of the odd-indexed rows are in A237271.
Lengths of the even-indexed rows give 2*A003056.
Row sums of the odd-indexed rows gives A000203, the sum of divisors function.
Row sums of the even-indexed rows give the positive even numbers (see A005843).
Row sums give A245092.
From the front view of the stepped pyramid emerges a geometric pattern which is related to A001227, the number of odd divisors of the positive integers.
The connection with the odd divisors of the positive integers is as follows: A261697 --> A261699 --> A237048 --> A235791 --> A237591 --> A237593 --> A237270 --> this sequence.

Examples

			Irregular triangle begins:
  1;
  1, 1;
  3;
  2, 2;
  2, 2;
  2, 1, 1, 2;
  7;
  3, 1, 1, 3;
  3, 3;
  3, 2, 2, 3;
  12;
  4, 1, 1, 1, 1, 4;
  4, 4;
  4, 2, 1, 1, 2, 4;
  15;
  5, 2, 1, 1, 2, 5;
  5, 3, 5;
  5, 2, 2, 2, 2, 5;
  9, 9;
  6, 2, 1, 1, 1, 1, 2, 6;
  6, 6;
  6, 3, 1, 1, 1, 1, 3, 6;
  28;
  7, 2, 2, 1, 1, 2, 2, 7;
  7, 7;
  7, 3, 2, 1, 1, 2, 3, 7;
  12, 12;
  8, 3, 1, 2, 2, 1, 3, 8;
  8, 8, 8;
  8, 3, 2, 1, 1, 1, 1, 2, 3, 8;
  31;
  9, 3, 2, 1, 1, 1, 1, 2, 3, 9;
  ...
Illustration of the odd-indexed rows of triangle as the diagram of the symmetric representation of sigma which is also the top view of the stepped pyramid:
.
   n  A000203    A237270    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   1     1   =      1      |_| | | | | | | | | | | | | | | |
   2     3   =      3      |_ _|_| | | | | | | | | | | | | |
   3     4   =    2 + 2    |_ _|  _|_| | | | | | | | | | | |
   4     7   =      7      |_ _ _|    _|_| | | | | | | | | |
   5     6   =    3 + 3    |_ _ _|  _|  _ _|_| | | | | | | |
   6    12   =     12      |_ _ _ _|  _| |  _ _|_| | | | | |
   7     8   =    4 + 4    |_ _ _ _| |_ _|_|    _ _|_| | | |
   8    15   =     15      |_ _ _ _ _|  _|     |  _ _ _|_| |
   9    13   =  5 + 3 + 5  |_ _ _ _ _| |      _|_| |  _ _ _|
  10    18   =    9 + 9    |_ _ _ _ _ _|  _ _|    _| |
  11    12   =    6 + 6    |_ _ _ _ _ _| |  _|  _|  _|
  12    28   =     28      |_ _ _ _ _ _ _| |_ _|  _|
  13    14   =    7 + 7    |_ _ _ _ _ _ _| |  _ _|
  14    24   =   12 + 12   |_ _ _ _ _ _ _ _| |
  15    24   =  8 + 8 + 8  |_ _ _ _ _ _ _ _| |
  16    31   =     31      |_ _ _ _ _ _ _ _ _|
  ...
The above diagram arises from a simpler diagram as shown below.
Illustration of the even-indexed rows of triangle as the diagram of the deployed front view of the corner of the stepped pyramid:
.
.                                 A237593
Level                               _ _
1                                 _|1|1|_
2                               _|2 _|_ 2|_
3                             _|2  |1|1|  2|_
4                           _|3   _|1|1|_   3|_
5                         _|3    |2 _|_ 2|    3|_
6                       _|4     _|1|1|1|1|_     4|_
7                     _|4      |2  |1|1|  2|      4|_
8                   _|5       _|2 _|1|1|_ 2|_       5|_
9                 _|5        |2  |2 _|_ 2|  2|        5|_
10              _|6         _|2  |1|1|1|1|  2|_         6|_
11            _|6          |3   _|1|1|1|1|_   3|          6|_
12          _|7           _|2  |2  |1|1|  2|  2|_           7|_
13        _|7            |3    |2 _|1|1|_ 2|    3|            7|_
14      _|8             _|3   _|1|2 _|_ 2|1|_   3|_             8|_
15    _|8              |3    |2  |1|1|1|1|  2|    3|              8|_
16   |9                |3    |2  |1|1|1|1|  2|    3|                9|
...
The number of horizontal line segments in the n-th level in each side of the diagram equals A001227(n), the number of odd divisors of n.
The number of horizontal line segments in the left side of the diagram plus the number of the horizontal line segment in the right side equals A054844(n).
The total number of vertical line segments in the n-th level of the diagram equals A131507(n).
The diagram represents the first 16 levels of the pyramid.
The diagram of the isosceles triangle and the diagram of the top view of the pyramid shows the connection between the partitions into consecutive parts and the sum of divisors function (see also A286000 and A286001). - _Omar E. Pol_, Aug 28 2018
The connection between the isosceles triangle and the stepped pyramid is due to the fact that this object can also be interpreted as a pop-up card. - _Omar E. Pol_, Nov 09 2022
		

Crossrefs

Famous sequences that are visible in the stepped pyramid:
Cf. A000040 (prime numbers)......., for the characteristic shape see A346871.
Cf. A000079 (powers of 2)........., for the characteristic shape see A346872.
Cf. A000203 (sum of divisors)....., total area of the terraces in the n-th level.
Cf. A000217 (triangular numbers).., for the characteristic shape see A346873.
Cf. A000225 (Mersenne numbers)...., for a visualization see A346874.
Cf. A000384 (hexagonal numbers)..., for the characteristic shape see A346875.
Cf. A000396 (perfect numbers)....., for the characteristic shape see A346876.
Cf. A000668 (Mersenne primes)....., for a visualization see A346876.
Cf. A001097 (twin primes)........., for a visualization see A346871.
Cf. A001227 (# of odd divisors)..., number of subparts in the n-th level.
Cf. A002378 (oblong numbers)......, for a visualization see A346873.
Cf. A008586 (multiples of 4)......, perimeters of the successive levels.
Cf. A008588 (multiples of 6)......, for the characteristic shape see A224613.
Cf. A013661 (zeta(2))............., (area of the horizontal faces)/(n^2), n -> oo.
Cf. A014105 (second hexagonals)..., for the characteristic shape see A346864.
Cf. A067742 (# of middle divisors), # cells in the main diagonal in n-th level.
Apart from zeta(2) other constants that are related to the stepped pyramid are A072691, A353908, A354238.

A024816 Antisigma(n): Sum of the numbers less than n that do not divide n.

Original entry on oeis.org

0, 0, 2, 3, 9, 9, 20, 21, 32, 37, 54, 50, 77, 81, 96, 105, 135, 132, 170, 168, 199, 217, 252, 240, 294, 309, 338, 350, 405, 393, 464, 465, 513, 541, 582, 575, 665, 681, 724, 730, 819, 807, 902, 906, 957, 1009, 1080, 1052, 1168, 1182, 1254, 1280, 1377, 1365
Offset: 1

Views

Author

Paul Jobling (paul.jobling(AT)whitecross.com)

Keywords

Comments

a(n) is the sum of proper non-divisors of n, the row sum in triangle A173541. - Omar E. Pol, May 25 2010
a(n) is divisible by A000203(n) iff n is in A076617. - Bernard Schott, Apr 12 2022

Examples

			a(12)=50 as 5+7+8+9+10+11 = 50 (1,2,3,4,6 not included as they divide 12).
		

Crossrefs

Cf. A342344 (for a symmetric representation).

Programs

  • Haskell
    a024816 = sum . a173541_row  -- Reinhard Zumkeller, Feb 19 2014
    
  • Magma
    [n*(n+1) div 2- SumOfDivisors(n): n in [1..60]]; // Vincenzo Librandi, Dec 29 2015
    
  • Maple
    A024816 := proc(n)
        n*(n+1)/2-numtheory[sigma](n) ;
    end proc: # R. J. Mathar, Aug 03 2013
  • Mathematica
    Table[n(n + 1)/2 - DivisorSigma[1, n], {n, 55}] (* Robert G. Wilson v *)
    Table[Total[Complement[Range[n],Divisors[n]]],{n,60}] (* Harvey P. Dale, Sep 23 2012 *)
    With[{nn=60},#[[1]]-#[[2]]&/@Thread[{Accumulate[Range[nn]],DivisorSigma[ 1,Range[nn]]}]] (* Harvey P. Dale, Nov 22 2014 *)
  • PARI
    a(n)=n*(n+1)/2-sigma(n) \\ Charles R Greathouse IV, Mar 19 2012
    
  • Python
    from sympy import divisor_sigma
    def A024816(n): return (n*(n+1)>>1)-divisor_sigma(n) # Chai Wah Wu, Apr 28 2023
    
  • SageMath
    def A024816(n): return sum(k for k in (0..n-1) if not k.divides(n))
    print([A024816(n) for n in srange(1, 55)])  # Peter Luschny, Nov 14 2023

Formula

a(n) = n*(n+1)/2 - sigma(n) = A000217(n) - A000203(n).
a(n) = A024916(n-1) - A153485(n), n > 1. - Omar E. Pol, Jun 24 2014
From Wesley Ivan Hurt, Jul 16 2014, Dec 28 2015: (Start)
a(n) = Sum_{i=1..n} i * ( ceiling(n/i) - floor(n/i) ).
a(n) = Sum_{k=1..n} (n mod k) + (-n mod k). (End)
G.f.: x/(1 - x)^3 - Sum_{k>=1} k*x^k/(1 - x^k). - Ilya Gutkovskiy, Sep 18 2017
From Omar E. Pol, Mar 21 2021: (Start)
a(n) = A244048(n) + A004125(n).
a(n) = A153485(n-1) + A004125(n), n >= 2. (End)
a(p) = (p-2)*(p+1)/2 for p prime. - Bernard Schott, Apr 12 2022

A004125 Sum of remainders of n mod k, for k = 1, 2, 3, ..., n.

Original entry on oeis.org

0, 0, 1, 1, 4, 3, 8, 8, 12, 13, 22, 17, 28, 31, 36, 36, 51, 47, 64, 61, 70, 77, 98, 85, 103, 112, 125, 124, 151, 138, 167, 167, 184, 197, 218, 198, 233, 248, 269, 258, 297, 284, 325, 328, 339, 358, 403, 374, 414, 420, 449, 454, 505, 492, 529, 520, 553, 578, 635, 586, 645, 672
Offset: 1

Views

Author

Keywords

Comments

Row sums of A051778, A048158. Antidiagonal sums of A051127. - L. Edson Jeffery, Mar 03 2012
Let u_m(n) = Sum_{k=1..n} (n^m mod k^m) with m integer. As n-->+oo, u_m(n) ~ (n^(m+1))*(1-(1/(m+1))*Zeta(1+1/m)). Proof: using Riemann sums, we have u_m(n) ~ (n^(m+1))*int(((1/x)[nonascii character here])*(1-floor(x^m)/(x^m)),x=1..+oo) and the result follows. - Yalcin Aktar, Jul 30 2008 [x is the real variable of integration. The nonascii character (which was illegible in the original message) is probably some form of multiplication sign. I suggest that we leave it the way it is for now. - N. J. A. Sloane, Dec 07 2014]
Also the alternating row sums of A236112. - Omar E. Pol, Jan 26 2014
If n is prime then a(n) = a(n-1) + n - 2. - Omar E. Pol, Mar 19 2014
If n is a power of 2 greater than 1, then a(n) = a(n-1). - David Morales Marciel, Oct 21 2015
It appears that if n is an even perfect number, then a(n) = a(n-1) - 1. - Omar E. Pol, Oct 21 2015
Partial sums of A235796. - Omar E. Pol, Jun 26 2016
Aside from a(n) = a(n-1) for n = 2^m, the only values appearing more than once among the first 6*10^8 terms are those at n = 38184 +- 1, 458010 +- 1, 776112 +- 1, 65675408 +- 1, and 113393280 +- 2. - Trevor Cappallo, Jun 07 2021
The off-by-1 terms in the comment above are the terms of A068077. Proof: If a(n-1) = a(n+1), then (n-1)^2 - Sum_{k=1..n-1} sigma(k) = (n+1)^2 - Sum_{k=1..n+1} sigma(k) via the formula; rearranging terms gives sigma(n)+sigma(n+1)=4n. - Lewis Chen, Sep 24 2021

Examples

			a(5) = 4. The remainder when 5 is divided by 2,3,4 respectively is 1,2,1 and their sum = 4.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000290, A006218, A023196, A048158, A050482, A051778, A120444 (first differences).

Programs

  • GAP
    List([1..70],n->n^2-Sum([1..n],k->Sigma(k))); # Muniru A Asiru, Mar 28 2018
    
  • Haskell
    a004125 n = sum $ map (mod n) [1..n]
    -- Reinhard Zumkeller, Jan 28 2011
    
  • Magma
    [&+[n mod r: r in [1..n]]: n in [1..70]]; // Bruno Berselli, Jul 06 2014
    
  • Maple
    A004125 := n -> add( modp(n,k), k=2..n); /* much faster and unambiguous; "a mod b" may be mods(a,b) */ # M. F. Hasler, Nov 22 2007
  • Mathematica
    Table[Sum[Mod[n,k],{k,2,n-1}],{n,70}] (* Harvey P. Dale, Nov 23 2011 *)
    Accumulate[Table[2n-1-DivisorSigma[1,n],{n,70}]] (* Harvey P. Dale, Jul 11 2014 *)
  • PARI
    A004125(n)=sum(k=2,n,n%k) \\ M. F. Hasler, Nov 22 2007
    
  • Python
    def a(n): return sum(n%k for k in range(1, n))
    print([a(n) for n in range(1, 63)]) # Michael S. Branicky, Jun 08 2021
    
  • Python
    from math import isqrt
    def A004125(n): return n**2+((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
    
  • SageMath
    def a(n): return sum(n.mod(k) for k in (1..n))
    print([a(n) for n in (1..62)])  # Peter Luschny, May 12 2025

Formula

a(n) = n^2 - Sum_{k=1..n} sigma(k) = A000290(n) - A024916(n), hence asymptotically a(n) = n^2*(1-Pi^2/12) + O(n*log(n)^(2/3)). - Benoit Cloitre, Apr 28 2002. Asymptotics corrected/improved by Charles R Greathouse IV, Feb 22 2015
a(n) = A008805(n-3) + A049798(n-1), for n > 2. - Carl Najafi, Jan 31 2013
a(n) = A000217(n-1) - A153485(n). - Omar E. Pol, Jan 28 2014
G.f.: x^2/(1-x)^3 - (1-x)^(-1) * Sum_{k>=1} k*x^(2*k)/(1-x^k). - Robert Israel, Aug 13 2015
a(n) = Sum_{i=1..n} (n mod i). - Wesley Ivan Hurt, Sep 15 2017
From Ridouane Oudra, May 12 2025: (Start)
a(n) = A067439(n) + A072514(n).
a(n) = Sum_{d|n} d*A067439(n/d).
a(p) = A067439(p), for p prime.
a(p^k) = A072514(p^(k+1))/p, for p prime and k >= 0. (End)
a(n) = A111490(n) - n. - Peter Luschny, May 12 2025

Extensions

Edited by M. F. Hasler, Apr 18 2015

A244049 Sum of all proper divisors of all positive integers <= n.

Original entry on oeis.org

0, 0, 0, 2, 2, 7, 7, 13, 16, 23, 23, 38, 38, 47, 55, 69, 69, 89, 89, 110, 120, 133, 133, 168, 173, 188, 200, 227, 227, 268, 268, 298, 312, 331, 343, 397, 397, 418, 434, 483, 483, 536, 536, 575, 607, 632, 632, 707, 714, 756, 776, 821, 821, 886, 902
Offset: 1

Views

Author

Omar E. Pol, Jun 24 2014

Keywords

Comments

The proper divisors of n are all divisors except 1 and n itself. Therefore noncomposite numbers have no proper divisors.
For the sum of all aliquot divisors of all positive integers <= n see A153485.
For the sum all divisors of all positive integers <= n see A024916.
a(n) = a(n - 1) if and only if n is prime.
For n >= 3 a(n) equals the area of an arrowhead-shaped polygon formed by two zig-zag paths and the Dyck path described in the n-th row of A237593 as shown in the Links section. Note that there is a similar diagram of A153485(n) in A153485. - Omar E. Pol, Jun 14 2022

Examples

			a(4) = 2 because the only proper divisor of 4 is 2 and the previous n contributed no proper divisors to the sum.
a(5) = 2 because 5 is prime and contributes no proper divisors to the sum.
a(6) = 7 because the proper divisors of 6 are 2 and 3, which add up to 5, and a(5) + 5 = 2 + 5 = 7.
		

Crossrefs

Programs

  • Mathematica
    propDivsRunSum[1] := 0; propDivsRunSum[n_] := propDivsRunSum[n] = propDivsRunSum[n - 1] + (Plus@@Divisors[n]) - (n + 1); Table[propDivsRunSum[n], {n, 60}] (* Alonso del Arte, Jun 30 2014 *)
    Accumulate[Join[{0},Table[Total[Most[Divisors[n]]]-1,{n,2,60}]]] (* Harvey P. Dale, Aug 12 2016 *)
    Accumulate[Join[{0}, Table[DivisorSigma[1, n] - n - 1, {n, 2, 55}]]] (* Amiram Eldar, Jun 18 2022 *)
  • PARI
    a(n) = sum(k=2, n, sigma(k)-k-1); \\ Michel Marcus, Mar 30 2021
    
  • Python
    from math import isqrt
    def A244049(n): return ((-n*(n+3)-(s:=isqrt(n))**2*(s+1) + sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1)))>>1)+1 # Chai Wah Wu, Oct 21 2023

Formula

a(n) = A024916(n) - A034856(n).
a(n) = A153485(n) - n + 1.
G.f.: (1/(1 - x))*Sum_{k>=2} k*x^(2*k)/(1 - x^k). - Ilya Gutkovskiy, Jan 22 2017
a(n) = A161680(n-1) - A004125(n). - Omar E. Pol, Mar 25 2021
a(n) = A000290(n) - A034856(n) - A004125(n). - Omar E. Pol, Mar 26 2021
a(n) = c * n^2 + O(n*log(n)), where c = Pi^2/12 - 1/2 = 0.322467... . - Amiram Eldar, Nov 27 2023

A344551 a(n) = Sum_{k=1..n} k^floor((n-k)/k).

Original entry on oeis.org

1, 2, 3, 5, 6, 11, 12, 20, 27, 40, 41, 93, 94, 133, 208, 328, 329, 658, 659, 1217, 1746, 2269, 2270, 5768, 6269, 8330, 12777, 20253, 20254, 45253, 45254, 74390, 113867, 146652, 161211, 401275, 401276, 532367, 886818, 1412574, 1412575, 3053234, 3053235, 4889475, 8396664
Offset: 1

Views

Author

Wesley Ivan Hurt, May 22 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[k^Floor[(n - k)/k], {k, n}], {n, 80}]
  • PARI
    a(n) = sum(k=1, n, k^(n\k-1)); \\ Seiichi Manyama, Jun 06 2021
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, x^k*(1-x^k)/(1-k*x^k))/(1-x)) \\ Seiichi Manyama, Jun 06 2021

Formula

a(n) ~ 3^((n - 3 - mod(n,3))/3). - Vaclav Kotesovec, May 28 2021
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k * (1 - x^k)/(1 - k*x^k). - Seiichi Manyama, Jun 06 2021

A244048 Antisigma(n) minus the sum of remainders of n mod k, for k = 1,2,3,...,n.

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 12, 13, 20, 24, 32, 33, 49, 50, 60, 69, 84, 85, 106, 107, 129, 140, 154, 155, 191, 197, 213, 226, 254, 255, 297, 298, 329, 344, 364, 377, 432, 433, 455, 472, 522, 523, 577, 578, 618, 651, 677, 678, 754, 762, 805, 826
Offset: 1

Views

Author

Omar E. Pol, Jun 23 2014

Keywords

Comments

For n > 1 a(n) is the sum of all aliquot parts of all positive integers < n. - Omar E. Pol, Mar 27 2021

Examples

			From _Omar E. Pol_, Mar 27 2021: (Start)
The following diagrams show a square dissection into regions that are the symmetric representation of A000203, A004125, A153485 and this sequence.
In order to construct every diagram we use the following rules:
At stage 1 in the first quadrant of the square grid we draw the symmetric representation of sigma(n) using the two Dyck paths described in the rows n and n-1 of A237593.
At stage 2 we draw a pair of orthogonal line segments (if it's necessary) such that in the drawing appears totally formed a square n X n. The area of the region that is above the symmetric representation of sigma(n) equals A004125(n).
At stage 3 we draw a zig-zag path with line segments of length 1 from (0,n-1) to (n-1,0) such that appears a staircase with n-1 steps. The area of the region (or regions) that is below the symmetric representation of sigma(n) and above the staircase equals a(n).
At stage 4 we draw a copy of the symmetric representation of A004125(n) rotated 180 degrees such that one of its vertices is the point (0,0). The area of the region (or regions) that is above of this region and below the staircase equals A153485(n).
Illustration for n = 1..6:
.                                                                    _ _ _ _ _ _
.                                                     _ _ _ _ _     |_ _ _  |_ R|
.                                        _ _ _ _ R   |_ _S_|  R|    | |_T | S |_|
.                             _ _ _ R   |_ _  |_|    | |_  |_ _|    |   |_|_ _  |
.                    _ _     |_S_|_|    | |_|_S |    |_U_|_T | |    |_  U |_T | |
.             _ S   |_ S|   U|_|_|S|    |_ U|_| |    |   | |_|S|    | |_    |_| |
.            |_|    |_|_|    |_|_|_|    |_|_ _|_|    |_V_|_U_|_|    |_V_|_ _ _|_|
.                  U        V   U       V
.
n:            1       2         3           4             5               6
R: A004125    0       0         1           1             4               3
S: A000203    1       3         4           7             6              12
T: a(n)       0       0         1           2             5               6
U: A153485    0       1         2           5             6              12
V: A004125    0       0         1           1             4               3
.
Illustration for n = 7..9:
.                                                      _ _ _ _ _ _ _ _ _
.                                _ _ _ _ _ _ _ _      |_ _ _S_ _|       |
.            _ _ _ _ _ _ _      |_ _ _ _  |     |     | |_      |_ _ R  |
.           |_ _S_ _|     |     | |_    | |_ R  |     |   |_    |_ S|   |
.           | |_    |_ R  |     |   |_  |_S |_ _|     |     |_  T |_|_ _|
.           |   |_  T |_ _|     |     |_T |_ _  |     |_ _    |_      | |
.           |_ _  |_    | |     |_ _  U |_    | |     |   |  U  |_    | |
.           |   |_U |_  |S|     |   |_    |_  | |     |   |_ _    |_  |S|
.           |  V  |   |_| |     |  V  |     |_| |     |  V    |     |_| |
.           |_ _ _|_ _ _|_|     |_ _ _|_ _ _ _|_|     |_ _ _ _|_ _ _ _|_|
.
n:                 7                    8                      9
R: A004125         8                    8                     12
S: A000203         8                   15                     12
T: a(n)           12                   13                     20
U: A153485        13                   20                     24
V: A004125         8                    8                     12
.
Illustration for n = 10..12:
.                                                         _ _ _ _ _ _ _ _ _ _ _ _
.                              _ _ _ _ _ _ _ _ _ _ _     |_ _ _ _ _ _  |         |
.     _ _ _ _ _ _ _ _ _ _     |_ _ _S_ _ _|         |    | |_        | |_ _   R  |
.    |_ _ _S_ _  |       |    | |_        |      R  |    |   |_      |     |_    |
.    | |_      | |_  R   |    |   |_      |_        |    |     |_    |_  S   |   |
.    |   |_    |_ _|_    |    |     |_      |_      |    |       |_    |_    |_ _|
.    |     |_      | |_ _|    |       |_   T  |_ _ _|    |         |_ T  |_ _ _  |
.    |       |_ T  |_ _  |    |_ _ _    |_        | |    |_ _        |_        | |
.    |_ _      |_      | |    |     |_ U  |_      | |    |   |    U    |_      | |
.    |   |_ U    |_    |S|    |       |_    |_    |S|    |   |_          |_    | |
.    |     |_      |_  | |    |         |     |_  | |    |     |_ _        |_  | |
.    |  V    |       |_| |    |  V      |       |_| |    |  V      |         |_| |
.    |_ _ _ _|_ _ _ _ _|_|    |_ _ _ _ _|_ _ _ _ _|_|    |_ _ _ _ _|_ _ _ _ _ _|_|
.
n:            10                         11                          12
R: A004125    13                         22                          17
S: A000203    18                         12                          28
T: a(n)       24                         32                          33
U: A153485    32                         33                          49
V: A004125    13                         22                          17
.
Note that in the diagrams the symmetric representation of a(n) is the same as the symmetric representation of A153485(n-1) rotated 180 degrees.
The original examples (dated Jun 24 2014) were only the diagrams for n = 11 and n = 12. (End)
		

Crossrefs

Programs

  • Mathematica
    With[{r=Range[100]},Join[{0},Accumulate[DivisorSigma[1,r]-r]]] (* Paolo Xausa, Oct 16 2023 *)
  • Python
    from math import isqrt
    def A244048(n): return (-n*(n-1)-(s:=isqrt(n-1))**2*(s+1) + sum((q:=(n-1)//k)*((k<<1)+q+1) for k in range(1,s+1)))>>1 # Chai Wah Wu, Oct 22 2023

Formula

a(n) = A024816(n) - A004125(n).
a(n) = A000217(n) - A000203(n) - A004125(n).
a(n) = A024916(n) - A000203(n) - A000217(n-1).
a(n) = A000217(n) - A123327(n).
a(n) = A153485(n-1), n >= 2.

A294016 a(n) = sum of all divisors of all positive integers <= n, minus the sum of remainders of n mod k, for k = 1, 2, 3, ..., n.

Original entry on oeis.org

1, 4, 7, 14, 17, 30, 33, 48, 57, 74, 77, 110, 113, 134, 153, 184, 187, 230, 233, 278, 301, 330, 333, 406, 419, 452, 479, 536, 539, 624, 627, 690, 721, 762, 789, 900, 903, 948, 983, 1084, 1087, 1196, 1199, 1280, 1347, 1400, 1403, 1556, 1573, 1660, 1703, 1796, 1799, 1932, 1967, 2096, 2143, 2208, 2211, 2428, 2431, 2500
Offset: 1

Views

Author

Omar E. Pol, Oct 22 2017

Keywords

Comments

a(n) is also the area (also the number of cells) of the n-th polygon formed by the Dyck path described in A237593 and its mirror, as shown below in the example.
a(n) is also the volume (and the number of cubes) in the n-th level (starting from the top) of the pyramid described in A294017.

Examples

			Illustration of initial terms:
.
.   _ 1
.  |_|_ _ 4
.    |   |
.    |_ _|_ _   7
.        |   |_
.        |_    |
.          |_ _|_ _ _  14
.              |     |_
.              |       |
.              |_      |
.                |_ _ _|_ _ _
.                      |     |  17
.                      |     |_ _
.                      |_ _      |
.                          |     |
.                          |_ _ _|_ _ _ _
.                                |       |_  30
.                                |         |_
.                                |           |
.                                |_          |
.                                  |_        |
.                                    |_ _ _ _|_ _ _ _
.                                            |       |
.                                            |       |_  33
.                                            |         |_ _
.                                            |_ _          |
.                                                |_        |
.                                                  |       |
.                                                  |_ _ _ _|
.
		

Crossrefs

Programs

  • Maple
    A294016 := proc(n)
        A024916(n)-A004125(n) ;
    end proc:
    seq(A294016(n),n=1..80) ; # R. J. Mathar, Nov 07 2017
  • Mathematica
    Accumulate[Table[2*(DivisorSigma[1, n] - n) + 1, {n, 1, 100}]] (* Amiram Eldar, Mar 30 2024 *)
  • Python
    from math import isqrt
    def A294016(n): return -(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))-n**2 # Chai Wah Wu, Oct 22 2023

Formula

a(n) = A024916(n) - A004125(n).
a(n) = A000290(n) - A067436(n).
From Omar E. Pol, Nov 05 2017: (Start)
a(n) = A000203(n) + A024816(n) + A153485(n) - A004125(n).
a(n) = A000217(n) + A153485(n) - A004125(n).
a(n) = A000203(n) + A153485(n) + A244048(n). (End)
a(n) = (Pi^2/6 - 1) * n^2 + O(n*log(n)). - Amiram Eldar, Mar 30 2024
Showing 1-10 of 31 results. Next