Numbers which are not the sum of distinct squares: Difference between revisions
Content added Content deleted
m (→{{header|ALGOL 68}}: comments) |
(Added Easylang) |
||
Line 482: | Line 482: | ||
</pre> |
</pre> |
||
=={{header|EasyLang}}== |
|||
{{trans|Lua}} |
|||
<syntaxhighlight lang=easylang> |
|||
maxNumber = 324 |
|||
len isSum[] maxNumber |
|||
maxSquare = floor sqrt maxNumber |
|||
# |
|||
proc flagSum currSum sqPos . . |
|||
nextSum = currSum + sqPos * sqPos |
|||
if nextSum <= maxNumber |
|||
isSum[nextSum] = 1 |
|||
for i = sqPos + 1 to maxSquare |
|||
flagSum nextSum i |
|||
. |
|||
. |
|||
. |
|||
for i = 1 to maxSquare |
|||
flagSum 0 i |
|||
. |
|||
for i = 1 to maxNumber |
|||
if isSum[i] = 0 |
|||
write i & " " |
|||
. |
|||
. |
|||
</syntaxhighlight> |
|||
=={{header|Go}}== |
=={{header|Go}}== |