<commit_before><commit_msg>Add solution to problem 14 written in Haskell<commit_after>listOfSequences = map collatzSequence [1..1000000]
listOfSubsetLengths = map length listOfSequences

main = print $ snd . maximum $ zip listOfSubsetLengths [1..]

collatz :: Integer -> Integer

collatz 1 = 1
collatz n = if (odd n)
    then (3 * n + 1)
    else n `div` 2

collatzSequence :: Integer -> [Integer]
collatzSequence = terminate . iterate collatz
    where
    terminate (1:_) = [1]
    terminate (x:xs) = x:terminate xs
{'fraction_non_alphanumeric': 0.10251450676982592, 'fraction_numerical': 0.03481624758220503, 'mean_word_length': 3.8867924528301887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4487815', 'n_tokens_mistral': 183, 'n_tokens_neox': 171, 'n_words': 56}