#!/usr/bin/env python3

from itertools import islice

def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 0xFFFF

A = generator(634, 16807)
B = generator(301, 48271)

part1 = sum(a == b for a, b in islice(zip(A, B), 40_000_000))
print(part1)

36e686a196bb41d9f655dad158c2cf0310273f0f
<mask token>


def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 65535


<mask token>

<mask token>


def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 65535


<mask token>
print(part1)

<mask token>


def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 65535


A = generator(634, 16807)
B = generator(301, 48271)
part1 = sum(a == b for a, b in islice(zip(A, B), 40000000))
print(part1)

from itertools import islice


def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 65535


A = generator(634, 16807)
B = generator(301, 48271)
part1 = sum(a == b for a, b in islice(zip(A, B), 40000000))
print(part1)

#!/usr/bin/env python3

from itertools import islice

def generator(n, factor):
    while True:
        n = n * factor % 2147483647
        yield n & 0xFFFF

A = generator(634, 16807)
B = generator(301, 48271)

part1 = sum(a == b for a, b in islice(zip(A, B), 40_000_000))
print(part1)
