I conjecture that $$ \left\lfloor\frac{2n}{p} \right\rfloor - 2 \left\lfloor \frac{n}{p} \right\rfloor \in \{ 0, 1 \}. $$ I know that it is always nonnegative, and equals $1$ for $n < p \le 2n$, but the general case for $n$ a natural number and $p$ prime is missing. Any hints?

  • 2
    $\begingroup$ Generally, if $x = k+\rho$ with $0 \leqslant \rho < 1$, then $$\lfloor 2x \rfloor - 2\lfloor x\rfloor = \lfloor 2k + 2\rho\rfloor - 2k = \lfloor 2\rho\rfloor.$$ $\endgroup$ – Daniel Fischer Jun 19 '15 at 21:48
  • $\begingroup$ Yes, that is really simple, thank you! $\endgroup$ – StefanH Jun 19 '15 at 21:50

By denoting with $\{x\}$ the fractional part of $x$, i.e. $x-\lfloor x\rfloor$, we have: $$ f_p(n)=\left\lfloor\frac{2n}{p} \right\rfloor - 2 \left\lfloor \frac{n}{p} \right\rfloor = \left\{\frac{2n}{p}\right\}-2\left\{\frac{n}{p}\right\}$$ where the RHS is trivially a periodic function with period $p$, so $f_p$ just detects if $n\pmod{p}$ is $>\frac{p}{2}$ or not.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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