Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- answer :: Integer
- goldbachNumbers :: Integral a => [a]
- squareDoubles :: Integral a => [a]
Documentation
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]