A377247 a(n) is the largest k such that the sum of the first k divisors of n is at most n.
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
Keywords
Examples
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.
Links
- David A. Corneth, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
A377247[n_] := LengthWhile[Accumulate[Divisors[n]], # <= n &]; Array[A377247, 100] (* Paolo Xausa, Aug 05 2025 *)
-
PARI
A377247(n) = {my(d = divisors(n), t = 0); for(i = 1, #d, t += d[i]; if(t > n, return(i-1))); 1}