Amicable pairs: Difference between revisions

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

edits