You need to take all possible combinations of the remainders. For example, x = 2, and y = 0, provide a solution mod 7.

]]>The squares mod 7 are 0,1,4,2,2,4,1, …

The differences mod 7 are 0,0,0,3,0,6,5, …

Since 4 doesn’t appear in the list of differences,

doesn’t that mean considering modulo 7 works just as well as 11?

This has been discussed for instance in

T. Mautsch, G.J. Woeginger

The sum of a cube and a fourth power

Crux Mathematicorum 34 (2008), pp 358-361

Here is a related problem, for which only modulus 13 (and its multiples) works:

Do there exist 20 consecutive integers, that can all be written as the

sum of a cube and a fourth power?