Need help finding equation that's close to geometric series sum but not.

LexFox

Hello! I need help finding an equation that takes two variables.

Problem in word form.
Billy has n game tokens to play arcade machines that take 1 game token each. After playing m games, the arcade gives him 1 game token back. How many total games t can Billy play with an inital n game tokens?

Work done so far
It looks a lot like a geometric sum, but sometimes it's less. Here's the equation I've been using so far:
Simplify:
$$\displaystyle \frac{1-n}{1-m}$$
With m=2 this works.
 n m t-n (1-n)/(1-m) 0 2 0 -1 1 2 0 0 2 2 1 1 3 2 2 2 4 2 3 3 5 2 4 4 6 2 5 5 7 2 6 6 8 2 7 7 9 2 8 8 10 2 9 9
But with m>2 it doesn't always. m=3 (values of n where my equation works are in bold):
 n m t-n (1-n)/(1-m) Difference 0 3 0 -0.5 -0.5 1 3 0 0 0 2 3 0 0.5 0.5 3 3 1 1 0 4 3 1 1.5 0.5 5 3 1 2 1 6 3 2 2.5 0.5 7 3 3 3 0 8 3 3 3.5 0.5 9 3 4 4 0 10 3 4 4.5 0.5 11 3 4 5 1 12 3 5 5.5 0.5 13 3 5 6 1 14 3 5 6.5 1.5 15 3 6 7 1 16 3 7 7.5 0.5 17 3 7 8 1 18 3 8 8.5 0.5 19 3 9 9 0 20 3 9 9.5 0.5 27 3 13 13 0 81 3 40 40 0
And m=4...
 n m t-n (1-n)/(1-m) Difference 0 4 0 -0.33 -0.33 1 4 0 0.00 0.00 2 4 0 0.33 0.33 3 4 0 0.67 0.67 4 4 1 1.00 0.00 5 4 1 1.33 0.33 6 4 1 1.67 0.67 7 4 1 2.00 1.00 8 4 2 2.33 0.33 9 4 2 2.67 0.67 10 4 2 3.00 1.00 11 4 2 3.33 1.33 12 4 3 3.67 0.67 13 4 4 4.00 0.00 14 4 4 4.33 0.33 15 4 4 4.67 0.67 16 4 5 5.00 0.00 17 4 5 5.33 0.33 18 4 5 5.67 0.67 19 4 5 6.00 1.00 20 4 6 6.33 0.33 64 4 21 21 0 256 4 85 85 0

Last edited:

romsek

MHF Helper
Let

$n$ be the original number of tokens

$m$ be the number of games played to get an additional game token

$N$ be the total number of games Billy gets to play

$K=\log_m(n)$

$N=\displaystyle{\sum_{k=0}^K}\left \lfloor \dfrac n {m^k} \right \rfloor$

LexFox

Thanks for the amazingly fast reply! Is it possible to write that formula without the sigma notation though?

romsek

MHF Helper
Thanks for the amazingly fast reply! Is it possible to write that formula without the sigma notation though?
well...

it's approximately

$\dfrac {1-(\frac 1 m)^{K+1}}{1-\frac 1 m}$

but not exact due to the floor function.