Amicable pairs: Difference between revisions

Content added Content deleted
(→‎{{header|PL/I-80}}: Added alternative version using a table of proper divisor sums)
(→‎{{header|PL/M}}: Improve the search)
Line 4,975: Line 4,975:
/* TEST EACH PAIR */
/* TEST EACH PAIR */
DO I=2 TO 20$000;
DO I=2 TO 20$000;
DO J=I+1 TO 20$000;
J = DIVSUM(I);
IF DIV$SUM(I)=J AND DIV$SUM(J)=I THEN DO;
IF J > I AND J <= 20$000 THEN DO;
IF DIV$SUM(J) = I THEN DO;
CALL PRINT$NUMBER(I);
CALL PRINT$NUMBER(I);
CALL PRINT(.', $');
CALL PRINT(.', $');