Sequence of non-squares: Difference between revisions
Add ABC
m (→{{header|Wren}}: Minor tidy) |
Not a robot (talk | contribs) (Add ABC) |
||
Line 34:
No squares found
</pre>
=={{header|ABC}}==
<syntaxhighlight lang="abc">HOW TO RETURN non.square n:
RETURN n + floor (1/2 + root n)
HOW TO REPORT square n:
REPORT n = (floor root n)**2
FOR n IN {1..22}: WRITE non.square n
WRITE /
IF NO n IN {1..1000000} HAS square non.square n:
WRITE "No squares occur for n < 1.000.000"</syntaxhighlight>
{{out}}
<pre>2 3 5 6 7 8 10 11 12 13 14 15 17 18 19 20 21 22 23 24 26 27
No squares occur for n < 1.000.000</pre>
=={{header|Ada}}==
|