Consider the line y=ax+b where b=2 and a=p1p2⋯pm for primes p1,p2,…,pm that will be chosen appropriately. We need to ensure that for a rational point (x,y), xy=z∈Z such that 1+az is a perfect square.
We construct the primes p1,p2,…,pm such that pi>20172017 and for all 1≤j≤m−1,
3k=j,1≤k≤m∏pk≡2(modpj).
This can be achieved by ensuring pm≡3∏k=j,1≤k≤m−1pk2(modpj), which is guaranteed by the Chinese Remainder Theorem and Dirichlet's theorem.
We claim that this construction works. Suppose 1+az≡x2(moda). Then for some x1,x2,…,xm∈{−1,1}, x≡xj(modpj).
Let vj be the unique integer such that vj≡0(modpi) for all i=j and vj≡2(modpj) with 1≤vj≤P. This implies that the set of x such that x2≡1(moda) in Za is of the form −1+∑j=1mejvj where ej∈{0,1}. Notice vj=pj3a for 1≤j≤m−1. For size reasons, 2<v1+⋯+vm−1=3a∑j=1m−1pj1<a. Therefore, 2<v1+⋯+vm<2a. Since v1+⋯+vm≡2(modpj) for all 1≤j≤m, it follows that v1+⋯+vm=a+2.
Step 1: Construct an interval with 2017+58=2075 blue points and 0 red points. Observe that the set ∑j=1m−1ejvj≡3∑ej(mod6). Therefore, if x=−1+∑j=1m−1ejvj, 3∣x2−1 (so 3∣ax2−1) and the parity of ax2−1 is also the same as the parity of x2−1, which is the parity of ∑ej.
Therefore, all z such that 1+az=(∑j=1m−1ejvj−1)2 for some e1+⋯+em−1 odd corresponds to a blue point because 3∣z and 2∤z and 4ax2+x=z has a solution with x∈Q. Hence, when 0<z<(∑j=1m−1vj−1)2, there is an interval of 2m−2>2075 blue points.
Step 2: Use discrete continuity.
Suppose we sort all z1<z2<⋯<z6×2m such that 1+azi=bi2 is a perfect square for all i. Then notice bi+2m=bi+a because there are 2m solutions to x2≡1(moda) in Za.
Consider zj+t2m for 0≤t≤5,1≤j≤2m. We can see zj+t2m=abj+t2m2−1=a(bj+ta)2−1.
We know a is either 1 or −1 mod 6. For any value of bj, we can set t∈{0,⋯,5} such that 3∣bj+ta and 2∤bj+ta, which forces a(bj+ta)2−1=zj to be divisible by 2 but not 3, which is red. Therefore, the number of red points among z1<⋯<z6×2m is at least 2m, while the number of blue points is at most 5×2m.
Let cj be the number of blue points among zj,⋯,zj+2074. Observe ∣cj+1−cj∣≤1 and ct=2075 for some t. Therefore, by discrete continuity, there exists cj=2017, finishing the problem.
The answer is: Yes.