This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; P40 (**) Goldbach's conjecture. | |
;; Goldbach's conjecture says that every positive even number greater than 2 is the sum of two prime numbers. Example: 28 = 5 + 23. It is one of the most famous facts in number theory that has not been proved to be correct in the general case. It has been numerically confirmed up to very large numbers (much larger than we can go with our Prolog system). Write a predicate to find the two prime numbers that sum up to a given even integer. | |
;; Example: | |
;; * (goldbach 28) | |
;; (5 23) | |
#lang racket | |
(provide goldbach) | |
(require "p39.ss") | |
(define (goldbach n) | |
(and (> n 2) (even? n) | |
(let loop ((lst (eratosthenes n))) | |
(let ((i (car lst))) | |
(let ((j (- n i))) | |
(if (member j lst) | |
`(,i ,j) | |
(loop (cdr lst)))))))) | |
Casino Rewards - Goo Millions
返信削除You can find the latest Casino 오락실 슬롯 머신 게임 Rewards 넷마블 토토 사이트 casino rewards 벳 365 우회 접속 in the app. betting From a welcome bonus w88 코리아 to $50 free spins, you'll get 100%