When a positive three-digit dividend with a units digit of 2 is divided by a positive one-digit divisor, the result is a whole-number quot... 
When a positive three-digit dividend with a units digit of 2 is divided by a positive one-digit divisor, the result is a whole-number quotient with a remainder of 1.  How many distinct values are possible for this three-digit dividend?


I think that the answer to this the number of 3 digit numbers ending with 1 that are not primes, but I don't have a method to find that in a reasonable amount of time.
 A: As the dividend is a three digit number ending with $2$, it is:
$$10d+2 \quad (10 \leqslant d \leqslant 99)$$
I assume you do not include $1$ as a satisfying one-digit divisor, since it would be weird to say remainder $1$ when divided by $1$ (if this isn't the case, any three digit number ending with $2$ would work and the answer would simply be $99-9=90$). We now take the remaining single-digit numbers into consideration.
Any three digit dividend satisfying you properties would show that $10d+1$ is divisible by some single digit number from $2$ to $9$. Clearly, $2$, $4$, $6$ or $8$ cannot divide $10d+1$ as the latter is an odd number. Moreover, as $5$ divides $10d$, $5$ cannot divide $10d+1$. The only remaining single digit numbers are $3$,$7$ and $9$. If $9$ divides $10d+1$, then $3$ would divide $10d+1$ too, since $9=3^2$. Thus, any number satisfying our properties is of the form $10d+1$ such that atleast one of $3$ or $7$ divide $10d+1$.
If $3$ divides $10d+1$, we have:
$$10d+1=3(3d)+(d+1) \implies d+1 \text{ is divisible by $3$}$$
This means that $d$ leaves remainder $2$ when divided by $3$. The possibilities are $d=11,14,\ldots,98$ which is $30$ possibilities.
If $7$ divides $10d+1$ if and only if $7$ divides $5(10d+1)=50d+5$. We have:
$$50d+5=7(7d)+(d+5) \implies d+5 \text{ is divisible by $7$}$$
This means that $d$ leaves remainder $2$ when divided by $7$. The possibilities are $d=16,23,\ldots,93$ which is $12$ possibilities.
However, we cannot simply add $30+12=42$ and say that $42$ is the answer. This is because if $10d+1$ is divisible by both $3$ and $7$, we would have counted this number twice. Thus, we have to remove all the numbers divisible by $3$ and $7$.
For a number $10d+1$ to be divisible by $3$ and $7$, we need $d$ to leave remainder $2$ when divided by $3$ and $7$. This means $d-2$ leaves remainder $0$ when divided by $3$ or $7$. This shows that $21$ divides $d-2$. Thus, $d-2$ can take values $21,42,63,84$ and thus, $d$ can take values $23,44,65,86$. Since these four values were counted twice, we remove them once. This means we remove $4$ possibilities.
The final answer is $30+12-4=38$ such unique three digit dividends.
public class Main{
public static void main(String[] args){
    // S is the number of unique three digit dividends
    int S=0;
    // i is a possible three digit dividend
    for(int i=100;i<1000;i++){
        if(i%10==2){
            // j is a possible one digit divisor
            for(int j=2;j<10;j++){
                if(i%j==1){
                    S+=1; break;
                    }
                }
            }
        }
        System.out.println(S);
    }
}

The above is a simple (and naive) Java program to verify our answer. You can check that the output is:
38

verifying that our answer is indeed right!
