WillNess
|
codepad
|
|
WillNess
|
Saved pastes by WillNess:
ps = 2 : _Y ((3:) . diff [5,7..] . unionAll . map (\p-> [p*p, p*p+2*p..]))
_Y g = g (_Y g)
unionAll ((x:xs):t) = x : (joyn xs . unionAll . pairs) t
where pairs (a:b:t) = joyn a b : pairs t
ordzip a b = g a b where { g a@(x:r) b@(y:q)
|
view (9 lines, 1 line of output) |
;;;; Stream Implementation
(define (head s) (car s))
(define (tail s) ((cdr s)))
(define-syntax s-cons
(syntax-rules () ((s-cons h t) (cons h (lambda () t)))))
|
view (77 lines, 3 lines of output) |
;;;; Stream Implementation
(define (head s) (car s))
(define (tail s) ((cdr s)))
(define-syntax s-cons
(syntax-rules () ((s-cons h t) (cons h (lambda () t)))))
|
view (77 lines, 3 lines of output) |
module Main where
main = do
let m = 31000000000 -- 31 bil on k', 11 bil on q'
ps = map (flip (-) m) $ primesFrom m
|
view (100 lines, 4 lines of output) |
module Main where
main = do
putStrLn "primes above 13,000,000,000:"
let m = 13000000000
|
view (27 lines, 3 lines of output) |