Skip to content

Instantly share code, notes, and snippets.

@dmalikov
Created November 29, 2011 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmalikov/1406656 to your computer and use it in GitHub Desktop.
Save dmalikov/1406656 to your computer and use it in GitHub Desktop.
Project Euler 179 (54s)
import Data.Numbers.Primes
import Control.Arrow ((***))
import Control.Monad (join)
import Data.List (group)
main = print . length . filter (==True) . map (uncurry (==) . join (***) (product . map ((1+) . length) . group . primeFactors)) $ [(x,x+1) | x <- [1..(10^7)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment