Maths Olympiad Prep

Library / /14 of 28

, 2024

Number theory Difficulty 5.2 AIME, harder Find the answer United States

Problem:

Estimate the number of positive integers n106n \leq 10^{6} such that n2+1n^{2}+1 has a prime factor greater than nn.

Submit a positive integer EE. If the correct answer is AA, you will receive max (0,20min(EA,106E106A)5+0.5)\left(0,\left\lfloor 20 \cdot \min \left(\frac{E}{A}, \frac{10^{6}-E}{10^{6}-A}\right)^{5}+0.5\right\rfloor\right) points.

Solution

Solution:

Let NN denote 10610^{6}. We count by summing over potential prime factors pp.

For any prime p>2p>2, we have that pn2+1p \mid n^{2}+1 for two values of nn if p1(mod4)p \equiv 1(\bmod 4), and zero values otherwise. Pretending these values are equally likely to be any of 1,,p1, \ldots, p, we expect the number of nn corresponding to a 1(mod4)1(\bmod 4) prime to be min(2,2Np)\min \left(2, \frac{2 N}{p}\right).

The number of primes up to xx is, by the Prime Number Theorem xlogx\frac{x}{\log x}. Assuming around half of the prime numbers are 1(mod4)1(\bmod 4), we on average expect some xx to be a 1(mod4)1(\bmod 4) prime 12logx\frac{1}{2 \log x} of the time. Approximating by an integral over potential primes xx from 1 to N2N^{2}, using our approximations, gives
1N2min(2,2Nx)dx2logx \int_{1}^{N^{2}} \min \left(2, \frac{2 N}{x}\right) \cdot \frac{d x}{2 \log x}
We now approximately calculate this integral as follows:
1N2min(2,2Nx)dx2logx=1Ndxlogx+NN2NxlogxdxNlogN+N(loglog(N2)loglogN)=NlogN+Nlog2 \begin{aligned} \int_{1}^{N^{2}} \min \left(2, \frac{2 N}{x}\right) \cdot \frac{d x}{2 \log x} & =\int_{1}^{N} \frac{d x}{\log x}+\int_{N}^{N^{2}} \frac{N}{x \log x} d x \\ & \approx \frac{N}{\log N}+N\left(\log \log \left(N^{2}\right)-\log \log N\right) \\ & =\frac{N}{\log N}+N \log 2 \end{aligned}
Here, for the first integral, we estimate logx\log x on [1,N][1, N] by logN\log N, and for the second integral, we use that the antiderivative of 1xlogx\frac{1}{x \log x} is loglogx\log \log x.

Using log20.7\log 2 \approx 0.7, one can estimate
logN=2log100020log214 \log N=2 \log 1000 \approx 20 \log 2 \approx 14
giving a final estimate of
106/14+1060.7=771428 10^{6} / 14+10^{6} \cdot 0.7=771428
This estimate yields a score of 15. If one uses the closer estimate log20.69\log 2 \approx 0.69, one gets the final estimate of 761428, yielding a score of 18.

Here is a code using sympy to calculate the final answer:
```
from sympy.ntheory import factorint
cnt = 0
for n in range(1, 106+1):
if max(factorint(n
2+1, multiple=True)) > n:
cnt += 1
print(cnt)
```

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.