Sum of a particular arithmetic sequence

57 Views Asked by At

Let the number $A$ have an unknown, positive value. The numbers $B$ and $C$ have defined values which are known. If we keep subtracting $B$ from $A$ as long as the difference is positive we get some smallest positive value. Let $C$ be the sum of all such positive differences.

As an example, let $$A = 7.2,\quad B = 0.5.$$ The largest multiple of $B$ we can subtract from $A$ and remain positive is $14B$. Hence, $$C = \sum_{k = 1}^{14} (A - kB) = 48.3.$$

Given $B$ and $C$, how can I express $A$ with a formula? Can't figure it out.

1

There are 1 best solutions below

0
On

I have a partial answer.

As mentioned in the comments, your wording is a little confusing. First you say that $C$ is the smallest positive number you can get by subtracting multiples of $B$ from $A$, but then you say that $C$ is the sum of all such positive differences. I will answer the latter, since it agrees with your example.

I will also assume that $B$ is positive.

We can subtract integer multiples of $B$ from $A$ until $A - kB$ is negative. The "last" one before that happens is $A - mB$, where $$A - (m + 1)B \leq 0 < A - mB.$$ These inequalities are equivalent to $$A - B \leq mB < A,$$ or $$\frac{A}{B} - 1 \leq m < \frac{A}{B}.$$ These inequalities are equivalent to $$m = \left\lceil \frac{A}{B} - 1 \right\rceil = \left \lceil \frac{A}{B} \right \rceil - 1,$$ where $\lceil x \rceil$ is the ceiling of $x$, the smallest integer greater than or equal to $x$.

Therefore, from your definition, $$C = \sum_{k = 1}^m (A - kB),$$ where $m = \lceil A / B \rceil - 1$. This sum evaluates nicely: $$C = mA - B \frac{m (m + 1)}{2}.$$ Assuming that $C > 0$, we will have $$A = \frac{C}{m} + B \frac{m + 1}{2} = \frac{C}{\lceil A / B \rceil - 1} + B \frac{\lceil A / B \rceil}{2}.$$

I am not immediately sure how to solve this equation for $A$, or even if it can be explicitly.