In this solution I will use a triple equals ≡ to indicate that the equation relies on modulus, rather than a direct equality.
First Problem
The numbers in the bag always form part of a linear arithmetic sequence y=mx+c, with the distances between the numbers being a fixed distance apart. Therefore they all have the same value mod m, where m is the HCF of their differences.
This means that if find the modulus in which the numbers are the same, you can find the value of c. A method of doing this would be to try factors of the difference between the closest two numbers, as the must be a multiple of the modulus.
You can then conclude that, for any integer, Z, numbers selected from the bags, their sum will be of the form m(x1+x2+...xZ) + cz, as all the numbers of the form mx+c, for different values of x. This is obviously cz more than a multiple of m. To complete the puzzle you must use the lowest remainder possible, which is cz (mod m).
To illustrate this method with an example, take the numbers in the bag to be 1, 4, 7 and 10, as in the original example, with z=4. Their differences are all a multiple of three, so by analysing them (mod 3) we find that they are all of the form 3x+1, for x=0, 1, 2 or 3. As z=4 and c=1, they must be cz=4 more than a multiple of the modulus, 3. 4≡1 (mod 3) so the final answer would be that 4 numbers selected from the bags must be 1 more than a multiple of 3.
Second problem
All of our numbers are of the form 4x-1, for x=1, 2, 3 or 4. Therefore the sum of 30 of them comes to 4(x1+x2+...x30)-30≡2 (mod 4). 412≡0 (mod 4), so this sum cannot be equal to 412. Therefore it is impossible to choose 30 numbers from 3, 7, 11 and 15 that sum to 412.