login
A369338
Sum of all the numbers less than each divisor d of n that do not divide d.
1
0, 0, 2, 3, 9, 11, 20, 24, 34, 46, 54, 64, 77, 101, 107, 129, 135, 175, 170, 217, 221, 271, 252, 325, 303, 386, 372, 454, 405, 546, 464, 594, 569, 676, 611, 803, 665, 851, 803, 968, 819, 1118, 902, 1180, 1096, 1261, 1080, 1482, 1188, 1522, 1391, 1669, 1377, 1878
OFFSET
1,3
FORMULA
a(n) = Sum_{d|n} Sum_{k=1..d} k * (ceiling(d/k) - floor(d/k)).
a(n) = Sum_{k=1..n} Sum_{i=1..k} i * (ceiling(k/i) - floor(k/i)) * (1 - ceiling(n/k) + floor(n/k)).
EXAMPLE
a(12) = 64. The divisors of 12 are {1,2,3,4,6,12}. There are 0 numbers (positive integers) less than 1, 0 numbers less than 2 not dividing 2, 1 number less than 3 not dividing 3 (namely 2), 1 number less than 4 not dividing 4 (namely 3), 2 numbers less than 6 not dividing 6 (namely 4 and 5) and 6 numbers less than 12 not dividing 12 (namely 5,7,8,9,10,11). The sum of the numbers is then: (2)+(3)+(4+5)+(5+7+8+9+10+11) = 64.
MATHEMATICA
Table[Sum[Sum[k (Ceiling[d/k] - Floor[d/k]), {k, d}], {d, Divisors[n]}], {n, 100}]
CROSSREFS
Cf. A369337.
Sequence in context: A109658 A257027 A271548 * A110350 A057569 A177950
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 20 2024
STATUS
approved