-- Problems/Problem050.hs
module Problems.Problem050 (p50) where

import Helpers.Primes

main = print p50

p50 :: Int
p50 = snd . maximum $ consecutivePrimeSums (take 546 primeNumbers)

consecutivePrimeSums :: [Int] -> [(Int,Int)]
consecutivePrimeSums [] = []
consecutivePrimeSums (x:xs) = (maximum $ filter (isPrime . snd) $ zip [1..] $ scanl (+) x xs):consecutivePrimeSums xs
