euler-0.1.0.0

Safe HaskellSafe
LanguageHaskell2010

Euler.Problems.Problem46

Synopsis

Documentation

answer :: Integer Source #

The smallest odd composite that cannot be written as the sum of a prime and twice a square.

goldbachNumbers :: Integral a => [a] Source #

All numbers that can be written as the sum of a prime and twice a square, in ascending order.

We're calling these number "goldbach numbers" after Christian Goldbach; this is just made-up terminology here for lack of a better word.

>>> take 20 goldbachNumbers
[4,5,7,9,10,11,13,15,19,20,21,23,25,27,29,31,33,34,35,37]

squareDoubles :: Integral a => [a] Source #

take 100 squareDoubles == map (\n -> 2 * n^2) [1..100]