|
|
A094471
|
|
a(n) = Sum_{(n - k)|n, 0 <= k <= n} k.
|
|
16
|
|
|
0, 1, 2, 5, 4, 12, 6, 17, 14, 22, 10, 44, 12, 32, 36, 49, 16, 69, 18, 78, 52, 52, 22, 132, 44, 62, 68, 112, 28, 168, 30, 129, 84, 82, 92, 233, 36, 92, 100, 230, 40, 240, 42, 180, 192, 112, 46, 356, 90, 207, 132, 214, 52, 312, 148, 328, 148, 142, 58, 552, 60
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Not all values arise and some arise more than once.
Sum of the largest parts of the partitions of n into two parts such that the smaller part divides the larger. - Wesley Ivan Hurt, Dec 21 2017
a(n) is also the sum of all parts minus the total number of parts of all partitions of n into equal parts (an interpretation of the Torlach Rush's formula). - Omar E. Pol, Nov 30 2019
If and only if sigma(n) divides a(n), then n is one of Ore's Harmonic numbers, A001599. - Antti Karttunen, Jul 18 2020
|
|
REFERENCES
|
P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 30.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n*tau(n) - sigma(n) = n*A000005(n) - A000203(n). [Previous name.]
If p is prime, then a(p) = p*tau(p)-sigma(p) = 2p-(p+1) = p-1 = phi(p).
If n>1, then a(n)>0.
|
|
EXAMPLE
|
q^2 + 2*q^3 + 5*q^4 + 4*q^5 + 12*q^6 + 6*q^7 + 17*q^8 + 14*q^9 + ...
For n = 4 the partitions of 4 into equal parts are [4], [2,2], [1,1,1,1]. The sum of all parts is 4 + 2 + 2 + 1 + 1 + 1 + 1 = 12. There are 7 parts, so a(4) = 12 - 7 = 5. - Omar E. Pol, Nov 30 2019
|
|
MAPLE
|
divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):
a := n -> local k; add(`if`(divides(n - k, n), k, 0), k = 0..n):
|
|
MATHEMATICA
|
Table[n*DivisorSigma[0, n] - DivisorSigma[1, n], {n, 1, 100}]
|
|
PROG
|
(PARI) {a(n) = n*numdiv(n) - sigma(n)} /* Michael Somos, Jan 25 2008 */
(SageMath)
def A094471(n): return sum(k for k in (0..n) if (n-k).divides(n))
(Julia)
using AbstractAlgebra
sum(k for k in 0:n if is_divisible_by(n, n - k))
end
(Python)
from math import prod
from sympy import factorint
f = factorint(n).items()
return n*prod(e+1 for p, e in f)-prod((p**(e+1)-1)//(p-1) for p, e in f)
|
|
CROSSREFS
|
Cf. A088827 (positions of odd terms).
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|