4. Find the number of distinct quadratic trinomials (i.e., with the leading coefficient equal to 1) with integer coefficients such that they have two distinct roots, which are powers of the number 5 with integer non-negative exponents, and at the same time, their coefficients in absolute value do not exceed $122^{20}$.
Answer: 5699.

Solution. Such quadratic trinomials can be represented in the form $\left(x-5^{a}\right)\left(x-5^{b}\right)$, where $a \geqslant 0$, $b \geqslant 0$ are integers. To avoid repetitions, we assume that $a>b$. Expanding the brackets, we get $x^{2}-\left(5^{a}+5^{b}\right) x+5^{a+b}$. According to the condition

$$
\left\{\begin{array} { l } 
{ 5 ^ { a } + 5 ^ { b } \leqslant 1 2 5 ^ { 5 0 } , } \\
{ 5 ^ { a + b } \leqslant 1 2 5 ^ { 5 0 } }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
5^{a}+5^{b} \leqslant 5^{150} \\
a+b \leqslant 150
\end{array}\right.\right.
$$

Note that if the second inequality holds, then the first inequality is true except for one case $a=150, b=0$. For each value of $a$, we list the number of suitable values of $b$:

$$
\begin{aligned}
& a=150 \Rightarrow 0 \text { values of } b \text {; } \\
& a=149 \Rightarrow 2 \text { values of } b(b \in\{0 ; 1\}) \text {; } \\
& a=148 \Rightarrow 3 \text { values of } b(b \in\{0 ; 1 ; 2\}) \text {; } \\
& a=76 \Rightarrow 75 \text { values of } b(b \in\{0 ; 1 ; \ldots ; 74\}) \text {; } \\
& a=75 \Rightarrow 75 \text { values of } b(b \in\{0 ; 1 ; \ldots ; 74\}) \text {; } \\
& a=74 \Rightarrow 74 \text { values of } b(b \in\{0 ; 1 ; \ldots ; 73\}) \text {; } \\
& a=73 \Rightarrow 73 \text { values of } b(b \in\{0 ; 1 ; \ldots ; 72\}) \text {; } \\
& a=1 \Rightarrow 1 \text { value of } b(b=0) \text {; } \\
& a=0 \Rightarrow 0 \text { values of } b \text {. }
\end{aligned}
$$

Summing up, we get $(2+3+4+\ldots 75)+(75+74+73+\ldots+1)=5699$ options.