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

Jul 2014
5
0
The nerd dimension
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:
Start with sum of geometric series: (1−m^(Log(n)/Log(m)))÷(1−m)
Simplify:
\(\displaystyle \frac{1-n}{1-m}\)
With m=2 this works.
nmt-n(1-n)/(1-m)
020-1
1200
2211
3222
4233
5244
6255
7266
8277
9288
10299
But with m>2 it doesn't always. m=3 (values of n where my equation works are in bold):
nmt-n(1-n)/(1-m)Difference
030-0.5-0.5
1
3
0
0
0
2300.50.5
3
3
1
1
0
4311.50.5
53121
6322.50.5
7
3
3
3
0
8333.50.5
9
3
4
4
0
10344.50.5
113451
12355.50.5
133561
14356.51.5
153671
16377.50.5
173781
183
88.50.5
19
3
9
9
0
20399.5
0.5
27
3
13
13
0
81
3
40
40
0
And m=4...
nmt-n(1-n)/(1-m)Difference
040-0.33-0.33
1
400.000.00
2400.330.33
3400.670.67
4
411.000.00
5411.330.33
6411.670.67
7412.001.00
8422.330.33
9422.670.67
10423.001.00
11423.331.33
12433.670.67
13
444.000.00
14444.330.33
15444.670.67
16
455.000.00
17455.330.33
18455.670.67
19456.001.00
20466.33
0.33
64
4
21
21
0
256
4
85
85
0
 
Last edited:

romsek

MHF Helper
Nov 2013
6,836
3,079
California
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$
 
Jul 2014
5
0
The nerd dimension
Thanks for the amazingly fast reply! Is it possible to write that formula without the sigma notation though?
 

romsek

MHF Helper
Nov 2013
6,836
3,079
California
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.