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.

A377247 a(n) is the largest k such that the sum of the first k divisors of n is at most n.

Original entry on oeis.org

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

Views

Author

David A. Corneth, Oct 21 2024

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.
		

Crossrefs

Cf. A081512, A117552 (corresponding sums).

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}