initialize total_amount_earned to 0.
initialize week_number to 1.
while the total_amount_earned is less than $1,000,000 do:
add to total_amount_earned the amount earned in week "week_number".
increment week_number.
Now when the loop terminates, what will the value of total_amount_earned and week_number be?
For example, total_amount_earned = 1, but week_number = 2, right? (because we increment
week_number). So you might need to output an "adjusted" week_number.
[EDIT: This is just one way to do it. There are other ways as well that don't require loops.]
10 weeks to become a millionaire, awesome. Though you could figure out whatever binary number(consisting of 1 followed by all zeroes) is closest to 100mil, and then the number of bits in that number is your answer.