For each odd prime power Formula: see text, and each integer Formula: see text, we determine the sum of the Formula: see text-th powers of all elements Formula: see text for which both Formula: see text and Formula: see text are squares in Formula: see text. We also solve the analogous problem when one or both of Formula: see text and Formula: see text is a nonsquare. We use these results to determine the sum of the elements of the image set Formula: see text for each Formula: see text of the form Formula: see text, which resolves two conjectures by Finch-Smith, Harrington, and Wong.
Ding et al. (2025) studied this question.