# Find sets of terms of given sequences

I want to find the sets of the terms of the sequences $$\left( n-2 \left[\frac{n}{2}\right]\right), \left( n-3 \left[\frac{n}{3}\right]\right)$$ and more general, if $$m$$ is natural the set of the terms of $$\left( n-m \left[\frac{n}{m}\right]\right)$$.

We know that $$\left( n-m \left[\frac{n}{m}\right]\right)$$ is equal to the largest integer $$k$$ for which $$k \leq \frac{n}{m}.

But how can we find a general form for the terms of the given sequences and consequently the desired sets?

• Have you tried just writing what $(n - 2 [n/2])$ equals for $n=1,2,3,4,\ldots$? If you just write things out, you might be able to find a pattern and then formalize your guess into a proof. – angryavian Nov 24 '19 at 22:17
• Note: $[n/2]=n/2$ when $n$ is even and $(n-1)/2$ when $n$ is odd – J. W. Tanner Nov 24 '19 at 22:17
• $n-m\left[\frac nm\right]=n \mod m$ – J. W. Tanner Nov 24 '19 at 22:20
• For $n=3k$ it holds that $\left[ \frac{n}{3}\right]=\frac{n}{3}$, for $n=3k+1$ it holds that $\left[ \frac{n}{3}\right]=\frac{n-1}{3}$ and for $n=3k+2$ it holds that $\left[ \frac{n}{3}\right]=\frac{n-2}{3}$, right? So if $n=3k$ then $n-3 \left[ \frac{n}{3}\right]=0$, if $n=3k+1$ then $n-3 \left[ \frac{n}{3}\right]=1$ and for $n=3k+2$ it holds that $n-3 \left[ \frac{n}{3}\right]=2$, right? – Mary Star Nov 24 '19 at 23:34

For natural number $$m$$ and integer $$n$$, $$n-m \left[\frac{n}{m}\right] \equiv n \bmod m$$. The sets are those of the integers modulo $$m$$, $$\mathbb{Z}/m\mathbb{Z}$$.