<jupyter_start><jupyter_text>Euler Problem 78Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can separated into piles in exactly seven different ways, so p(5)=7.    OOOOO    OOOO   O    OOO   OO    OOO   O   O    OO   OO   O    OO   O   O   O    O   O   O   O   OFind the least value of n for which p(n) is divisible by one million.<jupyter_code>def pentagonal(N):
    a, b = 1, 2
    delta = 4
    sgn = 1
    while a <= N:
        yield sgn, a
        a += delta
        if b <= N:
            yield sgn, b
            b += delta + 1
        delta += 3
        sgn = -sgn

P = {}
modulus = 10**6
P[0] = 1
n = 0
while P[n] != 0:
    n += 1
    P[n] = 0
    for sgn, g in pentagonal(n):
        P[n] += sgn * P[n-g]
        P[n] %= modulus
print(n)<jupyter_output>55374
{'fraction_non_alphanumeric': 0.09892729439809297, 'fraction_numerical': 0.028605482717520857, 'mean_word_length': 1.763157894736842, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '82749', 'license': 'MIT', 'n_tokens_mistral': 337, 'n_tokens_neox': 309, 'n_words': 122, 'path': 'Euler 078 - Coin partitions.ipynb', 'repo_name': 'Radcliffe/project-euler', 'size': '839'}