1

I am searching for a closed form solution for the following sum ($a \geq 0, b>0, c>0, n \geq 0$): $$ S(a,b,c,n) = \sum_{k=0}^{n} \left\lfloor \frac{a+k\,b}{c} \right\rfloor $$ I already found a closed form solution for the simpler case $$S(a,c,n) = \sum_{k=0}^{n} \left\lfloor \frac{a+k}{c} \right\rfloor$$ here Double sum over... and tried to proceed along this line of derivation, but there are two problems. First, I do not understand, why the sum there is solved for the condition $c > a$ only (indeed, for values of $a > c$ the closed form solution given there gives wrong results compared with evaluating the sum explicitly, but I don't see where this condition enters, or why it is imposed at all?), and second, I have problems with the Iverson bracket procedure applied to my case, namely when going from $$ \left[j \leq \frac{a+k\,b}{c} < j+1 \right] $$ to $$ \left[\frac{cj-a}{b} \leq k < \frac{c(j+1)-a}{b} \right] $$ which creates non-integer boundaries for the sum. Is there a way to proceed further or will it kill this approach totally?

I also found a solution for my case here Floor sum of Arithmetic Progression... but while this seems to work, it is a solution by means of a recursive function instead of a closed form expression. I do know that in principle one can get from a recursion to a closed form expression, but this case is far too complicated for me.

Alternatively, I tried to circumvent the floor function by using the identity $$ x \bmod y = x - y \left\lfloor \frac{x}{y} \right\rfloor $$ namely using $$ \left\lfloor \frac{x}{y} \right\rfloor = \frac{x - (x \bmod y)}{y} $$ but the modulo operation seems to be as worse as the floor function in terms for finding a solution for the sum $$ M(a,b,c,n) = \sum_{k=0}^{n} (a + k\,b) \bmod c $$ But of course, if this might be easier and has a closed form solution, then it also solves my problem.

Edit:

In case it could make the case simpler, by some consideration that eluded me so far, the sum I really want to calculate is $$ S(a,b,c,n) = \sum_{k=0}^{n} \left( \left\lfloor \frac{a+k\,b}{c} \right\rfloor + \left\lfloor \frac{a+k\,b-1}{c} \right\rfloor \right) $$ I thought of it as two instances of the same thing to calculate, and thus nothing special to remark upon, but maybe there is some clever argument, that could make use of the presence of two floor functions with enumerators differing by one, so that the more complicated expression really is easier to simplify or solve?

Edit 2:

I tried to start from the simpler expression $\left\lfloor j \big/ c \right\rfloor$. This gives sequences of the non-negative integers repeated $c$ times. There are some OEIS entries for these sequences and one can find the common generating function $$ \frac{x^{c}}{(1-x)(1-x^{c})} = \frac{1}{1-x}\cdot\frac{x^{c}}{1-x^{c}} $$ This corresponds to the series expansion $$ \left(\sum_{u=0}^{\infty} x^{u}\right)\left(x^{c} \sum_{v=0}^{\infty} \left(x^{c}\right)^{v} \right) = \left(\sum_{u=0}^{\infty} x^{u}\right)\left(\sum_{v=0}^{\infty} x^{cv+c} \right) $$ Now, the coefficient $x^{j}$ in this expansion should be equal to the result of the floor expression $$ \left\lfloor j \big/ c \right\rfloor = \left[x^{j}\right] \left(\sum_{u=0}^{\infty} x^{u}\right)\left(\sum_{v=0}^{\infty} x^{cv+c} \right)$$ Using rules for the coefficient operator one can transform this to $$ \left[x^{j}\right] x^{c} \left(\sum_{u=0}^{\infty} x^{u}\right)\left(\sum_{v=0}^{\infty} x^{cv} \right) = \left[x^{j-c}\right] \left(\sum_{u=0}^{\infty} x^{u}\right)\left(\sum_{v=0}^{\infty} x^{cv} \right) = \sum_{t=0}^{j-c} \left[x^{t}\right]\left(\sum_{u=0}^{\infty} x^{u}\right)\left[x^{j-c-t}\right]\left(\sum_{v=0}^{\infty} x^{cv} \right) $$ But then I don't know how to proceed further. This coefficients must be somewhat easy to determine, the sums look not terribly complicated, but it totally eludes me. The idea of it is essentially to find some combinatorial expression for this floor function, which can be easier to use for solving the aforementioned sum. Essentially, I think, the floor function tells us, in how many ways the number $j$ can be represented by the form $f(u,v) = u+cv+c$, which equals the coefficient of the series expansion of the generation function for these sequences. Maybe someone can comment on this idea, and whether the derivations I made are correct?

Edit 3:

Now, by thinking about it more, I think that $$ \left[x^{t}\right]\left(\sum_{u=0}^{\infty} x^{u}\right) = 1 $$ for any $t$, since the series expansion corresponds to the sequence of coefficients $1,1,1,1,1,\cdots$. And in the other case, I think the case distinction $$ \left[x^{j-c-t}\right]\left(\sum_{v=0}^{\infty} x^{cv} \right) = \begin{cases} 1 & \text{if $j-c-t=cv$} \\ 0 & \text{otherwise} \end{cases} $$ holds? Is this correct?

Edit 4:

The idea of the number $j-c$ being represented by the linear form $f(u,v) = u+cv$ has a solution (Popoviciu's theorem, related to Frobenius's coin exchange problem) as $$ \frac{j-c}{c}+\frac{1+c}{2c}+\frac{1}{c}\sum_{k=1}^{c-1} \frac{1}{\omega_{c}^{kj}-\omega_{c}^{k(j+1)}} $$ in which $\omega_{c} = \exp(i2\pi/c)$ is a complex root of unity. But, of course, the sum seems to be, again, intractable, since essentially it is a floor function in disguise. Or, maybe not? How does one spot a futile problem? :)

Iridium
  • 87
  • If $a,b,c$ are integers then there is hope for a nice closed form solution. If $a,b,c$ are arbitrary reals then probably not. Can you clarify the domain of your numbers? – Thomas Preu Aug 11 '22 at 08:20
  • Yes, all are integers. Thank you for this remark. – Iridium Aug 11 '22 at 08:28

1 Answers1

1

May be, you could play with

$$\large\color{red}{\lfloor x\rfloor=x-\frac 12+\frac 1\pi \tan ^{-1}(\cot (\pi x))}$$ giving at least a contiuous formula

$$S(a,b,c,n) = \sum_{k=0}^{n} \left\lfloor \frac{a+k\,b}{c} \right\rfloor=\frac{(n+1) (b \,n+2 a-c)}{2 c}+\frac 1\pi \sum_{k=0}^{n} \tan ^{-1}\left(\cot \left(\pi\frac{ a+k \,b}{c}\right)\right)$$

The first part should give an approximation. Now, the problem is the last summation that, may be, could be bounded.

For example $$S(2,5,11,1000)=227227$$ while the first term is $227181.5$

  • This is certainly an interesting fact, which might be good to know, but I guess it is similar to the modulo operation approach before, in that the difficulty is now shifted to the trigonometric function. – Iridium Aug 11 '22 at 10:19
  • @Iridium. You are correct – Claude Leibovici Aug 11 '22 at 15:38