module Main where main :: IO ()main = readLn >>= print . solve -- solve :: Int -> solve = primes primes :: Int -> [Int]primes n = go n 2 go :: Int -> Int -> [Int]go x i | i * i > x = [x] | x `mod` i == 0 = i : go (x `div` i) i | otherwise = go x $ succ i
100000000000000
[2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,5,5,5,5,5,5,5,5,5,5,5,5,5]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!