OFFSET
1,2
COMMENTS
It is enough to take x,y from {0,1,...,n^2-1}.
It appears that the number of distinct integers of the form x^(p^k) + y^(p^k) mod (p^k)^m for a prime p>2 and natural k is A121278(p)*p^(k-1)*p^(k*(m-2)) for m>1. For m=1 see A366418.
It appears that the number of distinct integers of the form x^n + y^n mod n^m for an odd n, m>1 is A121278(n)*n^(m-2).
PROG
(PARI) a(n) = #setbinop((x, y)->Mod(x, n^3)^n+Mod(y, n^3)^n, [0..n^2-1]); \\ Michel Marcus, Oct 14 2023
(Python)
def A366419(n):
m = n**3
return len({(pow(x, n, m)+pow(y, n, m))%m for x in range(n**2) for y in range(x+1)}) # Chai Wah Wu, Nov 13 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Albert Mukovskiy, Oct 11 2023
STATUS
approved