Problem

Source: Thailand 2023 TSTST2/3

Tags: number theory



If $d$ is a positive integer such that $d \mid 5+2022^{2022}$, show that $d=2x^2+2xy+3y^2$ for some $x, y \in \mathbb{Z}$ iff $d \equiv 3,7 \pmod {20}$.