Start from 1$ in first bag and in each next bag multiply by 2 of previous bag. Last bag will have remaining coins.
bag1 = 1 coin
bag2 = 2 coins
bag3 = 4 coins
bag4 = 8 coins
bag5 = 16 coins
bag6 = 32 coins
bag7 = 64 coins
bag8 = 128 coins
bag9 = 256 coins
bag10 = 489 coins