Sequence of non-squares: Difference between revisions

Add SETL
(Easylang)
(Add SETL)
Line 2,890:
end for;
end func;</syntaxhighlight>
 
=={{header|SETL}}==
<syntaxhighlight lang="setl">program sequence_of_non_squares;
print([nonsquare n : n in [1..22]]);
 
if exists n in [1..1000000] | is_square nonsquare n then
print("Found square", nonsquare n, "at", n);
else
print("No squares found up to 1 million");
end if;
 
op is_square(n);
return (floor sqrt n)**2 = n;
end op;
 
op nonsquare(n);
return n + floor(0.5 + sqrt n);
end op;
end program;</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 found up to 1 million</pre>
 
=={{header|Sidef}}==
2,096

edits