Sum of two adjacent numbers are primes: Difference between revisions

Content added Content deleted
(J)
m (J: simplify)
Line 139: 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:
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+/~<.@-: p:1+i.20
<lang J> (+/,&":'=',{.,&":'+',&":{:)"#. 0 1+/~<.-: p:1+i.20
3=1+2
3=1+2
5=2+3
5=2+3