This can be done quickly using Excel or a scientific calculator. For problem no. 1, the data that are multiples of 10 in the set are 10, 20, 30, 40 and 50 and the number of data points in the set are 45 since the data set is from 1-50 excluding the 5 numbers that are multiples of 10.
Mean=[(sum of all numbers from 1 to 50)-10-20-30-40-50]/[50-5]=25
The second problem is similar. The multiples of 3 here are 3, 6 and 9. There are 10-3 data points.
Mean = [(sum of numbers from 1-10)-3-6-9)]/[10-3]=5.2857