What would be a formula for this?

66 Views Asked by At

I'm trying to find a formula for this scenario:

I need \$$302$.

I gain \$$2$ every second.

I gain \$$5$ every $5$ seconds.

When will I reach \$$302$? Both of these rates are working together.

Visually:

$2 $2 $2 $2 ($2 $5) $2 $2 $2 $2 ($2 $5)

I'm able to find the answer by diving by \$$15$ and figuring out how many sequences there were, but I'm looking for an equation.

$302 / 15 = ~20$

$20$ x $5$s + $1$s = $101$s

1

There are 1 best solutions below

5
On BEST ANSWER

After $n$ seconds you have $2n+5\left\lfloor \frac{n}{5} \right\rfloor$ dollars. Now you want to find $n$ for which $$302 \leq 2n+5\left\lfloor \frac{n}{5} \right\rfloor$$ and since $\left\lfloor \frac{n}{5} \right\rfloor \leq \frac{n}{5}$ you have $$302 \leq 2n+5\frac{n}{5}=3n$$ so $n\geq 101$.

Here $\left\lfloor .\right\rfloor$ is the floor function.