Skip to content

Instantly share code, notes, and snippets.

@shirok
Created September 17, 2017 12:33
Show Gist options
  • Select an option

  • Save shirok/1bc47129a9cda28d9a2e0067137df96a to your computer and use it in GitHub Desktop.

Select an option

Save shirok/1bc47129a9cda28d9a2e0067137df96a to your computer and use it in GitHub Desktop.
(use math.prime)
(do ([p *primes* (cdr p)]
[n 1 (+ n 1)]
[sum 2 (+ sum (cadr p))])
[#f]
(when (integer? (/ sum n))
(format #t "f(~d) = ~d (~a)\n" n (/ sum n)
(if (bpsw-prime? (/ sum n)) "prime" "composite"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment