A roulette player had a system of playing one dollar 7 times, red or black, then 7 dollars 7 times, red or black, then 49 dollars 7 times, red or black, etc., each time 7 bets in increasing powers of 7.
How many times had he won if he finally won net 777,777 dollars?
For those not familiar with the roulette, in this particular bet, if you bet 1 dollar, either you lose it or gain another 1 dollar.
20 wins:
0 wins 7 losses at $1 -7
4 wins 3 losses at $7 +7
2 wins 5 losses at $49 -147
0 wins 7 losses at $343 -2401
5 wins 2 losses at $2401 +7203
2 wins 5 losses at $16807 -50421
7 wins 0 losses at $117649 +823543
-------
net winnings 777777
26 wins:
7 wins 0 losses at $1 +7
3 wins 4 losses at $7 -7
2 wins 5 losses at $49 -147
0 wins 7 losses at $343 -2401
5 wins 2 losses at $2401 +7203
2 wins 5 losses at $16807 -50421
7 wins 0 losses at $117649 +823543
-------
net winnings 777777
26 wins:
0 wins 7 losses at $1 -7
4 wins 3 losses at $7 +7
2 wins 5 losses at $49 -147
7 wins 0 losses at $343 +2401
4 wins 3 losses at $2401 +2401
2 wins 5 losses at $16807 -50421
7 wins 0 losses at $117649 +823543
-------
net winnings 777777
32 wins:
7 wins 0 losses at $1 +7
3 wins 4 losses at $7 -7
2 wins 5 losses at $49 -147
7 wins 0 losses at $343 +2401
4 wins 3 losses at $2401 +2401
2 wins 5 losses at $16807 -50421
7 wins 0 losses at $117649 +823543
-------
net winnings 777777