Problem: Let $S\subset[1989]={1,2,...,1989}$. If two elements of $S$ have that $a-b\neq4$ or $7$, find max$|S|$.
My solution is as follows: We first consider the first four integers $1,2,3,4$. Then if we add $4$ and $7$ to each of these numbers respectively, we would then have $5,6,7,8$ and $8,9,10,11$. So since we want the maximum number of elements of $S$, we should pick the next numbers right after $11$. These are $12,13,14,15$. Continuing this process, we have this sequence of vectors in $\mathbb R^4$; $a_n=(11(n-1)+1, 11(n-1)+2, 11(n-1)+3, 11(n-1)+4)$. So now, since the upper bound for this sequence is $\leq 1989$, we have to solve $11(n-1)+4 \leq 1989$. This yields the solution $1\leq n\leq 181$. Hence we have $max(|S|)$=$4(181)$=$724$. BUT WAIT! We overcounted! We over counted all of the times $(n+1)+7$=$(n+4)+4$. This happens in between every $a_{n-1}$ and $a_n$. But there $181$ such $n$. Hence there are $181$ such times when $(n+1)+7$=$(n+4)+4$. Thus we add back another $181$ and we have that (finally) $max(|S|)$=$4(181)+181$=$905$.
I would like to know if my solution is correct, because I feel as if my solution is not rigorous enough and I am afraid that I might be incorrect. If you see anything wrong with my proof, kindly please point out where I went wrong and maybe explain the strategies that would be needed so I wouldn't make the same mistake again. (I believe this is the 1989 AIME #13? Don't quote me on that)