Idoneal numbers: Difference between revisions
→{{header|ALGOL 68}}: Further simplification - don't need a loop to find c
(→{{header|Action!}}: Slight simplification) |
(→{{header|ALGOL 68}}: Further simplification - don't need a loop to find c) |
||
Line 84:
=={{header|ALGOL 68}}==
Note, AND does not shortcut in Algol 68.
<syntaxhighlight lang="algol68">
BEGIN # find idoneal numbers - numbers that cannot be written as ab + bc + ac #
Line 95 ⟶ 96:
FOR b FROM a + 1 TO n - 1
WHILE INT ab = a * b;
INT c = ( n - ab
AND (
DO SKIP
OD;
IF idoneal THEN
|