Subsets that their sum divides a number How can we apply the answer to this post Find number of $r$-element subset of $S$ satisfying a property to 31-element subsets of {1,2,3,...,1400} that their sum is divisible by 7?
In that post 5q+p-31q could easily solve the problem but what can we do when we want to do the same for 7?
 A: They are exactly $\frac{1}{7}$'th of all $\binom{1400}{31}$ subsets.
To each subset $S$ we can associate a tuple $(a_0,\dots,a_6)$ that tells us how many numbers of each congruence $\bmod 7$ are in $S$. Because the numbers $\{1,2,\dots,1400\}$ have exactly $200$ numbers of each congruence class $\bmod 7$ the number of subsets which satisfy a specific tuple is the same for tuple $(a_0,\dots,a_6)$ as it is for tuple $(a_6,a_0,\dots,a_5)$.
Notice that if we know the tuple of a set we can know what the sum of its elements are $\bmod 7$. Notice that if a a set has tuple $(a_0,\dots,a_6)$ and the sum is congruent to $x\bmod 7$ then the sets with tuple $(a_6,a_0,\dots,a_5)$ have sum congruent to $x+31$.
Since $31$ and $7$ are coprime this means that when you rotate the tuple $(a_0,\dots,a_6)$ seven times, these seven sums cover each of the congruence classes $\bmod 7$.
It follows that the number of $31$-sets with elements in $\{1,\dots,1400\}$ with sum congruent to $a\bmod 7$ is $\binom{1400}{31}/7$ for all $a$.
