The positive integers can be represented by 3n, 3n+1, 3n+2, where n is any positive integer.
But 3n+3=3(n+1), so 3n+2=3(n+1)-1, and n+1 is just another integer, so the natural numbers can always be represented by 3n±1.
It follows that (3n±1)2=9n2±6n+1=3n(3n±2)+1. But n(3n±2) is an integer so:
(3n±1)2=3m+1. 3m=(3n±1)2-1=(3n±1+1)(3n±1-1), that is, (3n+2)(3n) or (3n)(3n-2), both of which are integers divisible by 3. It follows that the square of a positive integer is of the form 3m or 3m+1.