O'Halloran numbers: Difference between revisions

Added Algol 68
m (→‎{{header|Raku}}: '×' for '*')
(Added Algol 68)
Line 28:
 
 
 
=={{header|ALGOL 68}}==
<syntaxhighlight lang="algol68">
BEGIN # find O'Halloran numbers - numbers that cannot be the surface area of #
# a cuboid with integer dimensions #
INT count := 0;
FOR n FROM 8 BY 2 TO 1000 DO
BOOL ohalloran := TRUE;
FOR l TO n WHILE ohalloran DO
FOR b TO n WHILE INT lb = l * b;
lb < n AND ohalloran
DO
FOR h TO n WHILE INT bh = b * h, lh = l * h;
INT sum = 2 * ( lb + bh + lh );
sum <= n
AND ( ohalloran := sum /= n )
DO SKIP OD
OD
OD;
IF ohalloran THEN
print( ( " ", whole( n, 0 ) ) );
count +:= 1
FI
OD
END
</syntaxhighlight>
{{out}}
<pre>
8 12 20 36 44 60 84 116 140 156 204 260 380 420 660 924
</pre>
 
=={{header|J}}==
3,045

edits