SHARE
TWEET

Goldbach Counterexample checker

a guest Mar 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. |=  n=@
  2. =<  (goldbach n)
  3. |%
  4. ++  prime
  5.   |=  n=@
  6.   ^-  ?
  7.   ?:  (lth n 2)  |
  8.   ?:  (lth n 4)  &
  9.   =/  i=@  2
  10.   =/  j=@  2
  11.   |-  ^-  ?
  12.   ?:  =((mul i j) n)  |
  13.   ?:  =(j (div n 2))  &
  14.   ?:  (gth (mul i j) n)
  15.     $(i 2, j +(j))
  16.   $(i +(i))
  17. ++  goldbach
  18.   |=  n=@
  19.   ^-  ?(? [[@ @] ?])
  20.   ?:  |((lth n 4) =((mod n 2) 1))  |
  21.   =/  i=@  2
  22.   =/  j=@  (sub n 2)
  23.   |-  ^-  ?(? [[@ @] ?])
  24.   ?:  &((prime i) (prime j))  [[i j] |]
  25.   ?:  =((add 2 i) n)  &
  26.   $(i +(i), j (dec j))
  27. --
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top