Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How many solutions are there for this equation:

$(n+1)x-\lfloor nx \rfloor = c$

I can prove some basic properties of floors and ceiling, but here I'm stumped.

share|cite|improve this question
Are $n$ and $c$ both supposed to be fixed, given quantities, so that only $x$ is an indeterminate? – Brian M. Scott Oct 10 '13 at 6:16
up vote 1 down vote accepted

Let $y_1(x) = (n+1)x$ and $y_2(x) = c + \lfloor nx \rfloor$. You want to find $x^*$ such that $y_1(x^*) = y_2(x^*)$. Let's look now to $y_2(x)$:

$$y_2(x) = k + c ~~ \forall x \in \left[\frac{k}{n}, \frac{k+1}{n}\right), k \in \mathbb{Z}$$

So you want to solve, for each $k$, the following equation: $$(n+1)x = k + c ~~ \forall x \in \left[\frac{k}{n}, \frac{k+1}{n}\right)$$ The solution is: $$x^* = \frac{k+c}{n+1}$$ This solution is feaseble if $x^*$ is in the set $\left[\frac{k}{n}, \frac{k+1}{n}\right)$. Then:

$$\frac{k+c}{n+1} \geq \frac{k}{n} \wedge \frac{k+c}{n+1} < \frac{k+1}{n}$$ Assuming that $n \in \mathbb{N}$, then: $$n(k+c) \geq k(n+1) \wedge n(k+c) < (k+1)(n+1)$$ $$k \leq nc \wedge k > nc-n-1$$ So you have solutions for each $k$ integer in the set $\left(nc-n-1, nc\right]$.

The length of this set is $n+1$, so you have $n +1$ solutions.

share|cite|improve this answer
Thanks you so very much! :) – Arek Krawczyk Oct 10 '13 at 10:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.