Mian-Chowla sequence: Difference between revisions

m
→‎{{header|Haskell}}: no need to unzip
m (added other names that the sequence is known as (to make searching for other names fruitful).)
m (→‎{{header|Haskell}}: no need to unzip)
Line 687:
mianChowlas :: Int -> [Int]
mianChowlas n =
letreverse (_,$ cm) = unzipsnd $ iterate nextMC (fromList [2], [1]) !! (n - 1)
in reverse $ cm !! (n - 1)
 
nextMC :: (Set Int, [Int]) -> (Set Int, [Int])
Anonymous user