Ejemplo n.º 1
0
def main():
    maxstreak, maxa, maxb = 0, 0, 0
    primes = set(libeuler.primeNumGenByTerm(200))

    for a in range(-999, 1000):
        for b in primes:
            if b > 1000:
                continue
            streak = 0
            n = 0
            while n * n + a * n + b in primes:
                streak += 1
                n += 1
            if streak > maxstreak:
                maxa = a
                maxb = b
                maxstreak = streak

    print(maxa, maxb, maxstreak)
    print(maxa * maxb)
Ejemplo n.º 2
0
def main():
    print(libeuler.primeNumGenByTerm(10001)[-1])