Jump to content

Product of min and max prime factors: Difference between revisions

m
Line 1,067:
import Data.Numbers.Primes (primeFactors)
import Text.Printf (printf)
 
 
----------- PRODUCT OF MIN AND MAX PRIME FACTORS ---------
 
oeisA066048 :: [Integer]
f = ((*) . head <*> last) . primeFactors
oeisA066048 = 1 : fmap f [2 ..]
 
where
f = ((*) . head <*> last) . primeFactors
 
--------------------------- TEST -------------------------
main :: IO ()
main = putStrLn $
table " " $ (chunksOf 10 . take 100) $
putStrLn $
table " " $ (chunksOf 10 . take 100) $ fmap show $ oeisA066048
1 : (f <$> [2 ..])
 
 
------------------------- DISPLAY ------------------------
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.