Count in factors: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: replace) |
|||
Line 529:
=={{header|Haskell}}==
Using <code>factorize</code> function from the [[Prime_decomposition#Haskell|prime decomposition]] task,
<lang haskell>*Main> :m +Data.List
*Main Data.List> mapM_ print $ "1":map (intercalate " * " . map show . factorize) [2..]
"1"
"2"
"3"
"2 * 2"
"5"
"2 * 3"
"7"
"2 * 2 * 2"
"3 * 3"
"2 * 5"
"11"
"2 * 2 * 3"
"13"
"2 * 7"
"3 * 5"
"2 * 2 * 2 * 2"
"17"
"2 * 3 * 3"</lang>
=={{header|Icon}} and {{header|Unicon}}==
|