An intger is simultaniously a square & cube is of the form 7k or 7k+1
He is asking to show that an integer that is a cube an a square at the same time either leaves 0 or remainder 1 upon division by zero.
Let $\displaystyle a = 7k,...,7k+6$ then $\displaystyle a^2 = 7k,7k+1,7k+2,7k+4$ and $\displaystyle a^3 = 7k,7k+1,7k+6$ the possible forms they have in common are $\displaystyle 7k,7k+1$.