-1

Consider the sequence $2,2^2,2^3,2^4,...$

(a) Show that the sequence is eventually periodic modulo $n$ and the period is less than $n$.

(b) Determine all positive integers $n$ for which the sequence is completely periodic modulo $n$.


Progress so far:

(a) Suppose the period is $k$, then we have $2^j \equiv 2^{j+k} \mod n$, where we assume that $n$ does not divide $2^j$. Then we have $n$ divides $2^j(2^k -1)$ which implies $n$ divides $2^k -1$.

(b) For all odd primes $n$ I think the sequence is completely periodic modulo $n$.


I am stuck with the problem. Need some hints to proceed.

Bill Dubuque
  • 272,048
user5210
  • 399
  • 2
    Are you familiar with the pigeonhole principle? – L. F. Apr 13 '23 at 22:29
  • Yes. I think that will help with part (a). @L.F. – user5210 Apr 13 '23 at 22:34
  • 2
    Very generally, given a finite set $X$ of cardinality $|X|>0$, an element $x\in X$, and a function $f\colon X\to X$, the sequence $f^{|X|-1}(x),\ f^{|X|}(x),\ f^{|X|+1}(x),\ \dots$ is periodic for purely combinatorial reasons.

    If $f$ is moreover a bijection, then $x,\ f(x),\ f^{2}(x),\ \dots$ is already periodic from the outset.

    (The superscripts of $f$ denote iterated composition.)

    – Rafi Apr 13 '23 at 22:45
  • Hint: don't reinvent the wheel (cycle). Instead use the fact that the orbits of a permutation are cycles as here and its links. Notice that the map $,x\to ax\pmod n,$ is a permutation $\iff $ it is invertibe $\iff a$ is invertible $!\bmod n$ $\iff \gcd(a,n)= 1.\ $ OP is case $,a = 2\ \ $ – Bill Dubuque Apr 13 '23 at 22:49
  • 1
    Task (a) is to prove that some sequence is periodic. You cannot accomplish that goal if you start out by assuming that the sequence is periodic. That is what you are doing when you write "Suppose the period is $k$...". That might be something to do if you already know it is periodic and you are trying to work out what the period is. But you can't establish something is true by assuming it is true. – 2'5 9'2 Apr 13 '23 at 23:11
  • @BillDubuque There's a little more to the analysis since the sequence doesn't start with $1$. It only needs to be a permutation on the image of $x\mapsto ax \pmod{n}$ here, so I believe the condition is $\gcd(a^2,n)\mid a$. (I am open to having made a mistake on this condition, though) – Brian Moehring Apr 14 '23 at 00:25

1 Answers1

-2

Eg. $2^n mod_7$:

$$2 = 2$$ $$2^2 = 4$$ $$2^3 = 8 = 1$$ $$2^4 = 2(2^3) = 2(1)= 2 (!)$$ $$2^5 = 2(2^4) = 2(2) = 4$$ $$2^6 = 2(2^5) = 2(4) = 1$$ $$2^7 = 2(2^6) = 2(1) = 2$$ $$...$$

a) Since $2^n$ always maps back into some other number within $\{0,1,2,3,4,5,6\}$ $mod_7$, after a maximum of 7 steps, perhaps less, the mapped value must repeat, at which point it will force the entire future sequence to cycle as well.

b) 7 is an odd prime, but the cycle period of $2^n$ is only 3, so there are likely subtler things to consider as to when the period will max out the modulo...

James
  • 770
  • Your answer to part (b) isn't actually answering the question as written. It's effectively asking whether $2^k \equiv 2 \pmod{n}$ for some $k > 1$. – Brian Moehring Apr 14 '23 at 00:12
  • @BrianMoehring that would mean that the cycle must always loop back to the very beginning ('o' form), instead of to some mid sequence point 'b' form? I don't know, but i have seen sequences $n^k$ where it does not loop the full starting cycle including $n^1$. – James Apr 14 '23 at 00:30
  • It doesn't have to loop back to the beginning for every $n$. OP is asking for which $n$ it does loop back to the beginning. My point is that you are answering the question of whether $2$ is a primitive root (or something of the sort) rather than the question of whether $(2^k \pmod{n})_{k\geq 1}$ is periodic. – Brian Moehring Apr 14 '23 at 00:33
  • @BrianMoehring could you write an answer to b) in group theoretic terms, please? – James Apr 14 '23 at 00:36