Find square difference: Difference between revisions

J
(Add Plain English)
(J)
Line 349:
<pre>501
501</pre>
 
=={{header|J}}==
Through inspection, we can see that the "square difference' for a number <code>n</code> is <code>(2*n)-1</code>:
<syntaxhighlight lang=J> (*: - *:&<:) 1 2 3 4 5
1 3 5 7 9</code>
 
Therefore, we expect that n=501 would give us a "square difference' of 1001. Testing, we can see that this is the case:
 
<syntaxhighlight lang=J> (*: - *:&<:) 501
1001</syntaxhighlight>
 
=={{header|jq}}==
6,951

edits