Evaluating $f(n)$ using mod function and floor function

54 Views Asked by At

For $n =1,2,3,\dots,12$, we are given that

$$\begin{bmatrix} n & f(n)\\ 1 & 0\\ 2 & 3\\ 3 & 2\\ 4 & 5\\ 5 & 0\\ 6 & 3\\ 7 & 5\\ 8 & 1\\ 9 & 4\\ 10 & 6\\ 11 & 2\\ 12 & 4 \end{bmatrix}$$

How to express $f(n)$ as $\mod(\left \lfloor \frac{an+b}{c} \right \rfloor,d)$, where $\left \lfloor \cdot \right \rfloor$ denotes the floor function, $a,b,c,d\in \mathbb{N}$?

1

There are 1 best solutions below

0
On

The definition of $f$ implies that $f(n) \equiv \left \lfloor \frac{an+b}{c} \right \rfloor \pmod d.$

From $f(5) - f(1) = 0$ we therefore have $$ \left\lfloor \frac{5a+b}{c} \right\rfloor - \left\lfloor \frac{a+b}{c} \right \rfloor \equiv 0 \pmod d, $$ or in other words there is an integer $k$ such that $$ \left\lfloor \frac{5a+b}{c} \right\rfloor - \left\lfloor \frac{a+b}{c} \right \rfloor = k d. $$

Note that in general, for any real number $x,$ we have $x - 1 < \lfloor x\rfloor \leq x.$ For any, $y,$ therefore, $-y \leq - \lfloor y\rfloor < 1 - y$ and $x - y - 1 < \lfloor x\rfloor - \lfloor y\rfloor < x - y + 1.$ Putting $x = \frac{5a+b}{c}$ and $y = \frac{a+b}{c},$ then $$ \frac{5a+b}{c} - \frac{a+b}{c} - 1 < \left\lfloor \frac{5a+b}{c} \right\rfloor - \left\lfloor \frac{a+b}{c} \right\rfloor < \frac{5a+b}{c} - \frac{a+b}{c} + 1, $$ which simplifies to $$ \frac{4a+b}{c} - 1 < kd < \frac{4a+b}{c} + 1. \tag1 $$

Similarly, from $f(5) - f(9) + 4 = 0$ we know there is an integer $h$ such that $$ \left\lfloor \frac{5a+b}{c} \right\rfloor - \left\lfloor \frac{9a+b}{c} \right \rfloor + 4 = h d, $$ and we also have $$ \frac{5a+b}{c} - \frac{9a+b}{c} + 3 < \left\lfloor \frac{5a+b}{c} \right\rfloor - \left\lfloor \frac{9a+b}{c} \right\rfloor + 4 < \frac{5a+b}{c} - \frac{9a+b}{c} + 5, $$ which then simplifies to $$ -\frac{4a+b}{c} + 3 < hd < -\frac{4a+b}{c} + 5. \tag2 $$

Combining the inequalities in $(1)$ and $(2),$ $$ 2 < (k + h)d < 6.$$

Assuming $d$ is positive, then $k + h > 0.$ But since $k$ and $h$ are integers, this implies $k + h \geq 1$ and therefore $d < 6.$ But $f(10) = 6$ requires that $d > 6.$ So we have a contradiction. Likewise we get a contradiction if we let $d$ be negative.

I do not think it is possible to define a function $f$ with the requested properties.