Find square difference: Difference between revisions

Content added Content deleted
(Find square difference in Verilog)
(Find square difference in Asymptote)
Line 52: Line 52:
Smallest n where n^2 - (n-1)^2 is > 1000 is: 501
Smallest n where n^2 - (n-1)^2 is > 1000 is: 501
</pre>
</pre>

=={{header|Asymptote}}==
<lang Asymptote>int fpow(int n) {
int i = 0;
while (i^2 - (i-1)^2 < n) ++i;
return i;
}

write(fpow(1000));</lang>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==