4. There are 306 different cards with numbers $3,19,3^{2}, 19^{2}, \ldots, 3^{153}, 19^{153}$ (each card has exactly one number, and each number appears exactly once). In how many ways can 2 cards be chosen so that the product of the numbers on the chosen cards is a square of an integer?
Answer: 17328.

Solution. To obtain the square of a natural number, it is necessary and sufficient that each factor enters the prime factorization of the number in an even power.

Suppose two cards with powers of three are chosen. We have 76 even exponents $(2,4,6, \ldots, 152)$ and 77 odd exponents $(1,3,5, \ldots, 153)$. We need the sum of the exponents to be even. For the sum of two natural numbers to be even, we can either choose two even numbers $\left(C_{76}^{2}=\frac{76 \cdot 75}{2}=2850\right)$, or two odd numbers ( $C_{77}^{2}=\frac{77 \cdot 76}{2}=2926$ ways). We get $2850+2926=5776$ ways.

The number of ways when both chosen cards have powers of the number 19 is exactly the same, i.e., 5776.

If one card with a power of three and one card with a power of the number 19 are taken, then both exponents must be even - we get $76 \cdot 76=5776$ ways.

In total: $5776 \cdot 3=17328$ ways.