Let N denote 106. We count by summing over potential prime factors p. For any prime p>2, we have that p∣n2+1 for two values of n if p≡1(mod4), and zero values otherwise. Pretending these values are equally likely to be any of 1,…,p, we expect the number of n corresponding to a 1(mod4) prime to be min(2,p2N). The number of primes up to x is, by the Prime Number Theorem logxx. Assuming around half of the prime numbers are 1(mod4), we on average expect some x to be a 1(mod4) prime 2logx1 of the time. Approximating by an integral over potential primes x from 1 to N2, using our approximations, gives ∫1N2min(2,x2N)⋅2logxdx We now approximately calculate this integral as follows: ∫1N2min(2,x2N)⋅2logxdx=∫1Nlogxdx+∫NN2xlogxNdx≈logNN+N(loglog(N2)−loglogN)=logNN+Nlog2 Here, for the first integral, we estimate logx on [1,N] by logN, and for the second integral, we use that the antiderivative of xlogx1 is loglogx. Using log2≈0.7, one can estimate logN=2log1000≈20log2≈14 giving a final estimate of 106/14+106⋅0.7=771428 This estimate yields a score of 15. If one uses the closer estimate log2≈0.69, one gets the final estimate of 761428, yielding a score of 18.