Amicable pairs: Difference between revisions
Content added Content deleted
m (ANSI Standard BASIC moved to the BASIC section.) |
(→{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.) |
||
Line 1,289: | Line 1,289: | ||
=={{header|BASIC}}== |
=={{header|BASIC}}== |
||
==={{header|ANSI |
==={{header|ANSI BASIC}}=== |
||
{{ |
{{trans|GFA Basic}} |
||
{{works with|Decimal BASIC}} |
|||
<syntaxhighlight lang=" |
<syntaxhighlight lang="basic">100 DECLARE EXTERNAL FUNCTION sum_proper_divisors |
||
110 CLEAR |
110 CLEAR |
||
120 ! |
120 ! |
||
Line 1,330: | Line 1,331: | ||
470 LET sum_proper_divisors = sum |
470 LET sum_proper_divisors = sum |
||
480 END FUNCTION</syntaxhighlight> |
480 END FUNCTION</syntaxhighlight> |
||
{{out}} |
|||
<pre> |
|||
Amicable pair 220 284 |
|||
Amicable pair 1184 1210 |
|||
Amicable pair 2620 2924 |
|||
Amicable pair 5020 5564 |
|||
Amicable pair 6232 6368 |
|||
Amicable pair 10744 10856 |
|||
Amicable pair 12285 14595 |
|||
Amicable pair 17296 18416 |
|||
-- found all amicable pairs |
|||
</pre> |
|||
==={{header|BASIC256}}=== |
==={{header|BASIC256}}=== |