# The form of a squared integer

1. Feb 7, 2012

### DEMJR

I want to prove that the square of any integer is in the form of 4n or 4n + 1.

I know that when we square any integer greater than 2 the result will be either divisible by four or four divides into the integer and leaves a remainder of one. How would I begin proving this in the most elementary of ways? I just need a boost, not the answer please. Thanks for all your help.

2. Feb 7, 2012

Hi DEMJR!

Hint: base 4

3. Feb 7, 2012

### mathman

(2n)n = 4nn = 4m.
(2n+1)n = 4nn +4n + 1 = 4k + 1.

4. Feb 8, 2012

### Mensanator

If you had a sequence of squares, how could you find the next one? (without using the square function)

5. Feb 9, 2012

### mathman

(n+1)2 = n2 + 2n + 1.

6. Feb 9, 2012

### Mensanator

Good. Now you know that the successor of 0mod4 is 1mod4. Now you just need to find the successor of 1mod4. When you have figured out the successor rules, you just need to find the initial state. Then, with the successor rules in hand, you can build a state machine. As uou already know, not every possible state will appear in the successor rules but the ones that do are good to infinity.

7. Feb 9, 2012

### ramsey2879

The answer to most any math problem is to simplify the problem by separately considering every possible state under which the problem can be considered. Working with base 4 as tiny tim suggested requires 4 states for consideration since the units place can be either 0,1,2 or 3. But mathman showed that one need only considered 2 states, either the numbered squared is even (i.e. 2n) or odd (i.e. 2n+1). Mensanator suggests using the successor rule of squares under which the next square state is obtained by adding 2n + 1 to the previous square state where n is the previous number that is squared. It is your choice of what course to take, either one will work.

P.S. do you know how to reduce a number or expression mod 4?, or that (4n + b)^2 = b^2 mod 4?

Last edited: Feb 9, 2012
8. Feb 9, 2012

### checkitagain

mathman,

what did you intend to make the chain of thought using the "n' variable?

In each of these, it works for n = 2. But the other positive integers?

9. Feb 10, 2012

### mathman

Typos which I didn't catch. Should be:

(2n)2 = 4n2 = 4m
(2n+1)2 =4n2 + 4n + 1 = 4k + 1