Problem 4 Prove that if n is a positive integer then n2 is c
Problem 4: Prove that if n is a positive integer, then n^2 is congruent to 0, 1, or 4 modulo
Solution
Let n be n integer.
Then n=4q+r, 0r<4 n=4q+r, 0r<4 with n¯=r¯n¯= r¯.
Then we have n^2=nn=(4q+r)^2=16q^2+8qr+r^2=4(4q^2+2qr)+r^2,0r^2<4 n^2=nn=(4q+r)^2=16q^2+8qr+r^2=4(4q^2+2qr)+r^2,0r2<4 with n^2¯=r^2¯n^2¯=r^2¯.
So then the possible values for r with r^2<4r^2<4 are 0,1. Then n^2¯=0¯n^2¯=0¯ or 1¯1¯.
And
Let n be n integer.
Then n=8q+r, 0r<8 n=8q+r, 0r<8 with n¯=r¯n¯=r¯.
Then we have n^2=nn=(8q+r)^2=64q^2+16qr+r^2=8(8q^2+2qr)+r^2,0r^2<8 n^2=nn=(8q+r)^2=64q^2+16qr+r^2=8(8q^2+2qr)+r^2,0r^2<8 with n^2¯=r^2¯n^2¯=r^2¯.
So then the possible values for r with r^2<8r^2<8 are 0,1,nnd 2. Then n^2¯=0¯n^2¯=0¯, 1¯ or 4¯.
