Narcissistic decimal number: Difference between revisions

Content added Content deleted
(→‎Haskell :: Reduced search: Simpler predicate, digitList domain extended to 0)
Line 2,025:
 
narcissiOfLength :: Int -> [Int]
narcissiOfLength nDigits = snd <$> digitTreego nDigits []
where
powers = ((,) <*> (^ nDigits)) <$> [0 .. 9]
digitTreego n parents =
bool
(filter (isDaffodil nDigits . snd) parents)
(digitTreego
(pred n - 1)
(bool
(parents >>=
Line 2,061:
putStrLn $
fTable
"NarcissiticNarcissistic decimal numbers of length 1-7:\n"
show
show
Line 2,074:
s : fmap (((++) . rjust w ' ' . xShow) <*> ((" -> " ++) . fxShow . f)) xs</lang>
{{Out}}
<pre>NarcissiticNarcissistic decimal numbers of length 1-7:
 
1 -> [0,1,2,3,4,5,6,7,8,9]