Alan and Bob are playing with numbers. Starting with the number n=1 they take turns performing arithmetic manipulations with n. Alan goes first and always multiplies n by 3. Bob adds 1 or 2 to the number n, depending on a coin toss. A number is called reachable, if it can possibly appear in this game. How many reachable numbers are there between 1 and 1000 (inclusive)?

Please don't post the question from brilliant dot org.

You're spoiling the essence of the challenges!