Sum of two adjacent numbers are primes: Difference between revisions
Sum of two adjacent numbers are primes (view source)
Revision as of 12:15, 25 January 2022
, 2 years agoJ: simplify
(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
|