def solve(): primes = 0 for i, n in enumerate(spiral(100000)): if is_prime(n): primes += 1 if primes / (i + 1) < 0.1 and i % 4 == 0 and primes > 0: return i // 2 + 1
def solve(): size = 1001 return sum(spiral((size - 1) // 2))