This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0007/euler0007.rkt

12 lines
272 B
Racket

#lang racket
(require math/number-theory)
(define (nth-prime it n primes)
(if (equal? n (length primes))
(car primes)
(if (prime? it)
(nth-prime (+ it 2) n (cons it primes))
(nth-prime (+ it 2) n primes))))
(nth-prime 3 10001 (list 2))