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.

This page as a plain text file.
%I A377247 #14 Aug 05 2025 13:35:28
%S A377247 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,
%T A377247 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,
%U A377247 3,6,1,9,1,3,5,5,3,6,1,8,4,3,1,9,3,3,3,6
%N A377247 a(n) is the largest k such that the sum of the first k divisors of n is at most n.
%H A377247 David A. Corneth, <a href="/A377247/b377247.txt">Table of n, a(n) for n = 1..10000</a>
%e A377247 a(1) = 1 as the sum of the first divisor of 1 is 1 <= 1 and 1 has no more divisors.
%e A377247 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.
%t A377247 A377247[n_] := LengthWhile[Accumulate[Divisors[n]], # <= n &];
%t A377247 Array[A377247, 100] (* _Paolo Xausa_, Aug 05 2025 *)
%o A377247 (PARI) A377247(n) = {my(d = divisors(n), t = 0); for(i = 1, #d, t += d[i]; if(t > n, return(i-1))); 1}
%Y A377247 Cf. A081512, A117552 (corresponding sums).
%K A377247 nonn
%O A377247 1,4
%A A377247 _David A. Corneth_, Oct 21 2024