Find square difference: Difference between revisions

m
(J)
Line 353:
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</codesyntaxhighlight>
 
Therefore, we expect that n=501 would give us a "square difference' of 1001. Testing, we can see that this is the case:
6,951

edits