Sum of two adjacent numbers are primes: Difference between revisions
Content added Content deleted
(J) |
m (J: simplify) |
||
Line 139:
Here, we generate the first 20 odd primes, divide by 2, drop the fractional part and add 0 and 1 to that value. Then we format that pair of numbers with their sum and with decorations indicating the relevant arithmetic:
<lang J> (+/,&":'=',{.,&":'+',&":{:)"#. 0 1+/~<.
3=1+2
5=2+3
|