Help me find the pattern/idea of this

71 Views Asked by At

I'm sorry for my bad english. English is not my main language.

I've been trying to study this and its patterns for a while. You can see this in many ways, but the first way I saw this was from a geometrical point of view. I saw this as convexes polygons. Firstly you'll say it has $n$ vertices, and display them from $0$ to $n-1$ in any direction. Then you'll go the vertex of the position you are $+1$, then $+2$, then $+3$ and so on.
For example let's say that $n=5$. Then You'll have: $$ -\:\: 0\:\: 1\:\: 2\:\: 3\:\: 4 $$ You start from $0$, then go to $0+1= 1$, then you go to $1+2 = 3$ etc.


Then you go to $3+3 = 6$. Note that if you represent this as a polygon you go back to $1$, since $$6 ≡ 1 \mod 5.$$

Eventually, if you keep doing these modulo sums, it results in a total of 3 vertices that you've passed through: 0,1,3. And lets put ${V(5) = 3}$.

Here's something I coded

The first thing I noticed was that $2^n$ polygons they reached all vertices.
Somehow the $n=2$ case is special. If, for example, you want to know $$ V(6) = V(2) \cdot V(3). $$ and $V(2)=2$
Multiplication seems working when you use even numbers. Another example: $$V(34) = 18,\quad V(17\cdot2) = V(17) \cdot V(2),$$ and $V(17) = 9$.
That might be the reason that $2^n$ polygons reach all vertices, since $V(2^n)$ is obtained as the $n$-fold product of $V(2)$ by itself. So its reasonable that it reaches all vertices.
Can anyone please help me find a better explanation and help me to dig this out?

Also, what if I need to calculate $V(n)$ when $n$ is odd? What's the way or expression to get there?

If you're confused, this might help. https://prnt.sc/pitus0

1

There are 1 best solutions below

7
On

The vertex numbers you find are all in the series $$0+1+2+3+... +k=\frac{k(k+1)}{2},$$

when considered modulo $n$.

If $n$ is an odd prime

The sum can be written as $\frac{1}{2}(k+\frac{1}{2})^2-\frac{1}{8}$ and the number of these modulo $n$ is the same as the number of squares i.e. $V(n)=\frac{n+1}{2}.$

Did you find that was always the case?

If $n$ is any odd number

By the proof given above, the answer is still the number of squares modulo $n$ and the easiest way of finding these is given by sequence https://oeis.org/A000224.

If $n$ is a power of 2

You have spotted a really interesting result that every integer can be written in the form $\frac{k(k+1)}{2}$ modulo such an $n$.

This can be proved by showing that for $0\le k<l\le n-1$ the two expressions $\frac{k(k+1)}{2}$ and $\frac{l(l+1)}{2}$ are different modulo $n$. We will then have $n$ different numbers of this form which is what we want.

The proof is to consider $$X=\frac{l(l+1)}{2}-\frac{k(k+1)}{2}=\frac{(l-k)(l+k+1)}{2}$$

Now only one of $l-k$ and $l+k+1$ can be even and so, for X to be $0$ modulo $n$, $2n$ must divide either $l-k$ or $l+k+1$. However, both these numbers are greater than $0$ but less than $2n$. Hence we do have have $n$ different numbers of the required form.