Subcontests
(4)alternating sums of {1,..,10}
Given a subset of {1,2,...,n}, we define its alternating sum in the following way: we order the elements of the subset in descending order and, starting with the largest, we alternately add and subtract the successive numbers. For example, the alternating sum of the set {1,3,4,6,8} is 8−6+4−3+1=4. Determines the sum of the alternating sums of all subsets of {1,2,...,10} with an odd number of elements. good positive integers - Portugal OPM 2020 p1
It is said that a positive integer is not GOOD, if there exists a permutation of the integers from 1 to n, (a1,a2,...,an) such that k+ak is a perfect square for all k. For example 5 is a GOOD number, since the permutation (3,2,1,5,4) checks the condition: 1+3=22, 2+2=22, 3+1=22; 4+5=32 and 5+4=32. Find all GOOD numbers up to 12.