Is $h(n)$ independent of $n$?

44 Views Asked by At

Let $n$ be a positive integer. Let $f(n) = \lfloor\frac{8n+13}{25}\rfloor$ and $g(n) = \lfloor\frac{n-17}{25}\rfloor$.

Now consider $$h(n) = f(n) - \lfloor\frac{n - 12 - g(n)}{3}\rfloor$$ Then I calculated values of $h(n)$ for various values of $n$ and I'm getting $h(n)=4 $ everytime. Infact I ran a C code also and verified it till $n = 10^6$. But I am not able to prove this equality. How can I prove this?

1

There are 1 best solutions below

0
On BEST ANSWER

Let $n=25k+r$ for some non-negative integers $k,r$ with $r<25$. We then have

$$\left\lfloor\frac{n-12-\left\lfloor\frac{n-17}{25}\right\rfloor}{3}\right\rfloor = \left\lfloor\frac{24k+r-12-\left\lfloor\frac{r-17}{25}\right\rfloor}{3}\right\rfloor = 8k-4+\left\lfloor\frac{r-\left\lfloor\frac{r-17}{25}\right\rfloor}{3}\right\rfloor.$$

We also have

$$\left\lfloor\frac{8n+13}{25}\right\rfloor=8k+\left\lfloor\frac{8r+13}{25}\right\rfloor.$$

So it suffices to show that for any non-negative integer $r<25$,

$$\left\lfloor\frac{8r+13}{25}\right\rfloor - \left\lfloor\frac{r-\left\lfloor\frac{r-17}{25}\right\rfloor}{3}\right\rfloor=0.$$

Try showing that this is true.