Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Pandigital numbers contain each of the digits [1..n] exactly once. For example: 21, 213, and 52314 are pandigital; 0, 11, 13, and 23 are not.
Euler problems 41 and 43 deal with pandigital numbers.
Synopsis
- pandigitals :: Integral a => [a]
- pandigitalsRev :: Integral a => [a]
- pandigitalsRevOfLength :: (Integral a, Integral b) => a -> [b]
Documentation
pandigitals :: Integral a => [a] Source #
All pandigitals, in no particular order.
pandigitalsRev :: Integral a => [a] Source #
All pandigitals, ordered from greatest to least. The first number in this list is 987,654,321, and the last is 1.
pandigitalsRevOfLength :: (Integral a, Integral b) => a -> [b] Source #
The 1-to-n pandigitals, ordered from greatest to least.
>>>
pandigitalsRevOfLength 3
[321,312,231,213,132,123]