Problem 1016
Alice writes the integers from 1 to 8.She separates them into two groups of four and realizes that the sum of the squares of the numbers in the first group (the one that contains 1) is equal to the sum of the squares of the numbers in the second group.
- 1A, 1B, 1C. What are, in ascending order, the other three numbers of the first group?
- 2A. In how many ways can she divide them into two groups of four such that the sum of the squares of the first group is equal to the sum of the squares of the second group?
- 2B. In how many ways can he separate the numbers into two groups of six such that the sum of the squares of the first group equals the sum of the squares of the second group?
- 2C. And in two groups of different size?
For this problem, a simple enumeration suffices. The only differences between the questions are the first number, the last number, and the fact that the groups are of equal size or not. The program written uses defines for these values.
- Question 1: N = 8, OFFSET = 1, EGAL = 1 (EGAL means EQUAL)
- Question 2.A: N = 8, OFFSET = 21, EGAL = 1
- Question 2.B: N = 12, OFFSET = 1, EGAL = 1
- Question 2.C: N = 12, OFFSET = 1, EGAL = 0
- 1A, 1B, 1C. 4, 6 and 7.
- 2A. There is only one way to separate the integers from 21 to 28 into two groups of equal size, with the same sum of squares.
- 2B. There is only one way to separate the integers from 1 to 12 into two groups of six, with the same sum of squares.
- 2C. There are 4 ways to separate integers from 1 to 12 into two groups of unequal size, with the same sum of squares.