Period finding: Why x^r (mod N) is a periodic function?











up vote
0
down vote

favorite












If I take an example, I can observe that it is the case, but I am not able to understand why an exponentially rising function x^r would hit say x^r (mod N) periodically.



r is a variable here, and x and N are given inputs.



Example: N = 21, x = 2, then period is 6.



2^6(mod21) = 1, 2^12(mod21) = 1.










share|cite|improve this question




















  • 1




    How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
    – robjohn
    Nov 15 at 17:11










  • @robjohn r is any positive integer, N and x are inputs.
    – adekate
    Nov 15 at 17:17










  • @adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
    – robjohn
    Nov 15 at 17:26






  • 1




    @adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
    – robjohn
    Nov 15 at 17:38








  • 1




    @adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
    – robjohn
    Nov 15 at 18:06

















up vote
0
down vote

favorite












If I take an example, I can observe that it is the case, but I am not able to understand why an exponentially rising function x^r would hit say x^r (mod N) periodically.



r is a variable here, and x and N are given inputs.



Example: N = 21, x = 2, then period is 6.



2^6(mod21) = 1, 2^12(mod21) = 1.










share|cite|improve this question




















  • 1




    How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
    – robjohn
    Nov 15 at 17:11










  • @robjohn r is any positive integer, N and x are inputs.
    – adekate
    Nov 15 at 17:17










  • @adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
    – robjohn
    Nov 15 at 17:26






  • 1




    @adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
    – robjohn
    Nov 15 at 17:38








  • 1




    @adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
    – robjohn
    Nov 15 at 18:06















up vote
0
down vote

favorite









up vote
0
down vote

favorite











If I take an example, I can observe that it is the case, but I am not able to understand why an exponentially rising function x^r would hit say x^r (mod N) periodically.



r is a variable here, and x and N are given inputs.



Example: N = 21, x = 2, then period is 6.



2^6(mod21) = 1, 2^12(mod21) = 1.










share|cite|improve this question















If I take an example, I can observe that it is the case, but I am not able to understand why an exponentially rising function x^r would hit say x^r (mod N) periodically.



r is a variable here, and x and N are given inputs.



Example: N = 21, x = 2, then period is 6.



2^6(mod21) = 1, 2^12(mod21) = 1.







modular-arithmetic






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 15 at 17:20

























asked Nov 15 at 17:09









adekate

248




248








  • 1




    How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
    – robjohn
    Nov 15 at 17:11










  • @robjohn r is any positive integer, N and x are inputs.
    – adekate
    Nov 15 at 17:17










  • @adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
    – robjohn
    Nov 15 at 17:26






  • 1




    @adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
    – robjohn
    Nov 15 at 17:38








  • 1




    @adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
    – robjohn
    Nov 15 at 18:06
















  • 1




    How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
    – robjohn
    Nov 15 at 17:11










  • @robjohn r is any positive integer, N and x are inputs.
    – adekate
    Nov 15 at 17:17










  • @adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
    – robjohn
    Nov 15 at 17:26






  • 1




    @adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
    – robjohn
    Nov 15 at 17:38








  • 1




    @adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
    – robjohn
    Nov 15 at 18:06










1




1




How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
– robjohn
Nov 15 at 17:11




How many values can $x^r$ take mod $N$? At some point, it has to get back to some place it was previously.
– robjohn
Nov 15 at 17:11












@robjohn r is any positive integer, N and x are inputs.
– adekate
Nov 15 at 17:17




@robjohn r is any positive integer, N and x are inputs.
– adekate
Nov 15 at 17:17












@adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
– robjohn
Nov 15 at 17:26




@adekate: Yes. $2^r$ can take at most $21$ values $bmod{21}$. That means that given $22$ values of $r$, $2^r$ must equal some earlier $2^{r-p}$ $bmod{21}$.
– robjohn
Nov 15 at 17:26




1




1




@adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
– robjohn
Nov 15 at 17:38






@adekate: it can take at most $21$ values since there are only $21$ distinct residue classes mod $21$. As it turns out there are fewer before $2^r$ actually repeats, but the fact that there are only $21$ residue classes, puts an upper limit on things (see Pigeonhole Principle).
– robjohn
Nov 15 at 17:38






1




1




@adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
– robjohn
Nov 15 at 18:06






@adekate: the multiplicative group mod $21$ has $12$ elements, so it turns out that the period of any element mod $21$ will divide $12$. To find out the period of a particular element, one usually has to check that element. Note that $6^r$ has period $2$ and $4^r$ has period $3$.
– robjohn
Nov 15 at 18:06

















active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999974%2fperiod-finding-why-xr-mod-n-is-a-periodic-function%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999974%2fperiod-finding-why-xr-mod-n-is-a-periodic-function%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater