close
login
A377247
a(n) is the largest k such that the sum of the first k divisors of n is at most n.
2
1, 1, 1, 2, 1, 3, 1, 3, 2, 3, 1, 4, 1, 3, 3, 4, 1, 4, 1, 4, 3, 3, 1, 6, 2, 3, 3, 5, 1, 6, 1, 5, 3, 3, 3, 6, 1, 3, 3, 6, 1, 6, 1, 5, 5, 3, 1, 7, 2, 5, 3, 5, 1, 6, 3, 6, 3, 3, 1, 9, 1, 3, 5, 6, 3, 6, 1, 5, 3, 6, 1, 9, 1, 3, 5, 5, 3, 6, 1, 8, 4, 3, 1, 9, 3, 3, 3, 6
OFFSET
1,4
LINKS
EXAMPLE
a(1) = 1 as the sum of the first divisor of 1 is 1 <= 1 and 1 has no more divisors.
a(6) = 3 as the sum of the first three divisors is 1+2+3 <= 6 but the sum of the first four divisors is 1 + 2 + 3 + 6 = 12 > 6.
MATHEMATICA
A377247[n_] := LengthWhile[Accumulate[Divisors[n]], # <= n &];
Array[A377247, 100] (* Paolo Xausa, Aug 05 2025 *)
PROG
(PARI) A377247(n) = {my(d = divisors(n), t = 0); for(i = 1, #d, t += d[i]; if(t > n, return(i-1))); 1}
CROSSREFS
Cf. A081512, A117552 (corresponding sums).
Sequence in context: A304795 A036459 A356159 * A294926 A079167 A304793
KEYWORD
nonn
AUTHOR
David A. Corneth, Oct 21 2024
STATUS
approved