Check out Project Euler, they have problems which start out fairly easy and get progressively harder. Lessons learnt in earlier questions are needed for later questions. Note that one has to come up with a clever solution, brute force isn't the answer, so some research is involved.
Even though the very first question can be solved with any ordinary and seemingly obvious code, there is actually a mathematical shortcut.
There are many other similar type sites such as online judge etc.