a)Find the next whole number n, above 4, for which the set {1,2,...,n} can be partitioned into two subsets S and T of the same size, with the sum of the numbers in S equal to the sum of the numbers in T.

If S = T, then the sum S+T must be an even number, because dividing an odd number by 2 will give non-whole-number halves.

Also, there should be even number of numbers in the set S+T. So that S and T shall have same number of numbers, or S and T be same in size.

Next to 4, n might be 6. Test that:

{1,2,3,4,5,6}

1+2+3+4+5+6 = 21 ...an odd number, so cannot be.

Next n might be 8. Test:

{1,2,3,4,5,6,7,8}

1+2+3+4+5+6+7+8 = 36 ...an even number, so possible set.

For S = T here, then S = T = 36/2 = 18 each subset.

There are 8 numbers in it.

So S and T will have 4 numbers each.

Let us take the first 4 numbers----1,2,3,4.

1 would be in S

2 would be in T. So now T is 1 more than S. So we put 4 in S and the 3 in T---so that S=T for the first 4 numbers.

4 be in S

3 be in T

Now, S=T=5 in sums.

Then the other 4 numbers---5,6,7,8.

5 be in S

6 be in T. Here T is 1 more than S again. So we put the 8 in S and the 7 in T, to balance again.

8 be in S

7 be in T

That would give:

S = {1,4,5,8} = 1+4+5+8 = 18

T = {2,3,6,7} = 2+3+6+7 = 18

S and T have same size and same sum, so, OK.

Therefore, the next n is 8. ----answer.

-----------------

b)Find all partitions in (a) with the additional property of that the sum of the squares of the numbers in S equals the sum of the squares of the numbers T.

Next to 4, n might be 6. Test that:

{1,2,3,4,5,6}

1^2 +2^2 +3^2 +4^2 +5^2 +6^2

1 +4 +9 +16 +25 +36 = 91 ...an odd number, so cannot be again.

Next n might be 8. Test:

{1,2,3,4,5,6,7,8}

1^2 +2^2 +3^2 +4^2 +5^2 +6^2 +7^2 +8^2

1 +4 +9 +16 +25 +36 +49 +64 = 204 ...an even number, possible.

If S=T here, then S = T = 204/2 = 102 each subset.

By trial and error, I arrived at:

S = {1,4,6,7} = 1 +16 +36 +49 = 102

T = {2,3,5,8} = 4 +9 +25 +64 = 102

Therefore, next n is 8 also. ----answer.