First, prove a lemma.
Lemma: If p is an odd prime, when x runs through a complete residue system modulo p, x2 modulo p can take exactly 2p+1 values from 0,1,⋯,p−1.
Proof of the lemma: When x≡0(modp), x2≡0(modp).
When p×x,
if x12≡x22(modp),x1=x2(modp), then
p∣(x1+x2)(x1−x2),p∣(x1+x2).
Thus, x1≡−x2(modp).
This way, 1,2,⋯,p−1 can be divided into 2p−1 groups
(1,p−1),(2,p−2),⋯,(2p−1,2p+1).
The squares of numbers in the same group are congruent modulo p, and the squares of numbers in different groups are not congruent modulo p.
Therefore, the quadratic residues can take exactly 1+2p−1=2p+1 values.
Next, solve the original problem.
When there exists x∈Z such that x2+ax+b≡0(mod167), then there is an integer solution (x,y), i.e.,
4x2+4ax+4b≡0(mod167),
a2−4b≡(2x+a)2(mod167).
Therefore, for a given value of a, a2−4b is a quadratic residue modulo 167.
By the lemma, a2−4b modulo 167 can take 84 different values, so b modulo 167 can take 84 different values.
Since 1672004=12, each a corresponds to 84×12 values of b that satisfy the requirement, thus, there are
2004×84×12=2020032
ordered integer pairs.
The sequence a0,a1,a2,⋯ is defined as follows:
For all k(k⩾0),
a0=2,ak+1=2ak2−1