You are viewing a single comment's thread. Return to all comments →
Since the content of the array was not specified, I returned a list of all prime numbers :-)
primes :: [Integer] primes = let s l = head l : s [n | n <- tail l, n mod head l /= 0] in s [2..]
mod
fn n = take n primes
Seems like cookies are disabled on this browser, please enable them to open this website
Array Of N Elements
You are viewing a single comment's thread. Return to all comments →
Since the content of the array was not specified, I returned a list of all prime numbers :-)
primes :: [Integer] primes = let s l = head l : s [n | n <- tail l, n
mod
head l /= 0] in s [2..]fn n = take n primes