<jupyter_start><jupyter_text>Part 2<jupyter_code>def play(n):
    recipes = [3, 7]
    elf1, elf2 = 0, 1

    while len(recipes) < n:

        e1, e2 = recipes[elf1], recipes[elf2]
        new_recipe = e1 + e2
        ext = (1, new_recipe%10) if new_recipe // 10 else (new_recipe%10,)
        recipes.extend(ext)

        # Count to new
        elf1 = (elf1 + e1 + 1) % len(recipes)
        elf2 = (elf2 + e2 + 1) % len(recipes)

        if recipes[-6:] == [3, 8, 0, 6, 2, 1]:
            break
            
        # It took me ages to realize that you have to check this too...
        if recipes[-7:-1] == [3, 8, 0, 6, 2, 1]:
            break
        
    return len(recipes)-6, recipes[-15:]
play(50000000)
# Wrong
# 80261429<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14342105263157895, 'fraction_numerical': 0.08157894736842106, 'mean_word_length': 1.949612403100775, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '138368', 'license': 'Apache-2.0', 'n_tokens_mistral': 328, 'n_tokens_neox': 289, 'n_words': 79, 'path': 'day14.ipynb', 'repo_name': 'kwinkunks/aoc18', 'size': '760'}