vectorCmEfs n = VS.foldl' (+) 0 $ VS.concatMap (\(!x) -> VS.enumFromStepN 1 1 x) $ VS.enumFromStepN 1 1 n
{-# NOINLINE vectorCmEfs #-}

flattenCmEfs :: Int -> Int
flattenCmEfs n = VS.foldl' (+) 0 $ VS.flatten mk step Unknown $ VS.enumFromStepN 1 1 n where
  mk x = (x,1)
  step (x,k)
    | k>x = VS.Done
    | otherwise = VS.Yield k (x,k+1)
{-# NOINLINE flattenCmEfs #-}

-- concatMap / concatMap

