What is the correct term for a nonrepeating cyclic sequence?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I was looking for a way to produce pseudo-random numbers within a certain range that do not repeat and I came up with the following formula:



$x_n = (x_n-1 + s) mod r$



This has the property that, when $s$ and $r$ are coprime, $x$ does not repeat with $r$ iterations.



For example, consider:



$r = 10, s = 7, x_0 = 0$



$x_1 = (0 + 7) mod 10 = 7$



$x_2 = (7 + 7) mod 10 = 4$



$x_3 = (4 + 7) mod 10 = 1$



And so on. The full sequence is: $0, 7, 4, 1, 8, 5, 2, 9, 6, 3$. As you can see, it is pseudo-random-ish. With larger, well-chosen values of $r$ and $s$ the relationship between the numbers is less obvious.



I have two questions about this:



First, does this formula have a name (and if so, what is it)?



Second, what is the proper term for this type of sequence? I've tried searching with variations on "nonrepeating cyclic sequence" but not found what I'm looking for. The main characteristic that I'm looking for is that the numbers in the sequence must not repeat until all of the numbers in the range have been output. Ultimately, I'd like to find sequences where the relationship between the numbers is not obvious (pseudo-random).







share|cite|improve this question























    up vote
    0
    down vote

    favorite












    I was looking for a way to produce pseudo-random numbers within a certain range that do not repeat and I came up with the following formula:



    $x_n = (x_n-1 + s) mod r$



    This has the property that, when $s$ and $r$ are coprime, $x$ does not repeat with $r$ iterations.



    For example, consider:



    $r = 10, s = 7, x_0 = 0$



    $x_1 = (0 + 7) mod 10 = 7$



    $x_2 = (7 + 7) mod 10 = 4$



    $x_3 = (4 + 7) mod 10 = 1$



    And so on. The full sequence is: $0, 7, 4, 1, 8, 5, 2, 9, 6, 3$. As you can see, it is pseudo-random-ish. With larger, well-chosen values of $r$ and $s$ the relationship between the numbers is less obvious.



    I have two questions about this:



    First, does this formula have a name (and if so, what is it)?



    Second, what is the proper term for this type of sequence? I've tried searching with variations on "nonrepeating cyclic sequence" but not found what I'm looking for. The main characteristic that I'm looking for is that the numbers in the sequence must not repeat until all of the numbers in the range have been output. Ultimately, I'd like to find sequences where the relationship between the numbers is not obvious (pseudo-random).







    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I was looking for a way to produce pseudo-random numbers within a certain range that do not repeat and I came up with the following formula:



      $x_n = (x_n-1 + s) mod r$



      This has the property that, when $s$ and $r$ are coprime, $x$ does not repeat with $r$ iterations.



      For example, consider:



      $r = 10, s = 7, x_0 = 0$



      $x_1 = (0 + 7) mod 10 = 7$



      $x_2 = (7 + 7) mod 10 = 4$



      $x_3 = (4 + 7) mod 10 = 1$



      And so on. The full sequence is: $0, 7, 4, 1, 8, 5, 2, 9, 6, 3$. As you can see, it is pseudo-random-ish. With larger, well-chosen values of $r$ and $s$ the relationship between the numbers is less obvious.



      I have two questions about this:



      First, does this formula have a name (and if so, what is it)?



      Second, what is the proper term for this type of sequence? I've tried searching with variations on "nonrepeating cyclic sequence" but not found what I'm looking for. The main characteristic that I'm looking for is that the numbers in the sequence must not repeat until all of the numbers in the range have been output. Ultimately, I'd like to find sequences where the relationship between the numbers is not obvious (pseudo-random).







      share|cite|improve this question











      I was looking for a way to produce pseudo-random numbers within a certain range that do not repeat and I came up with the following formula:



      $x_n = (x_n-1 + s) mod r$



      This has the property that, when $s$ and $r$ are coprime, $x$ does not repeat with $r$ iterations.



      For example, consider:



      $r = 10, s = 7, x_0 = 0$



      $x_1 = (0 + 7) mod 10 = 7$



      $x_2 = (7 + 7) mod 10 = 4$



      $x_3 = (4 + 7) mod 10 = 1$



      And so on. The full sequence is: $0, 7, 4, 1, 8, 5, 2, 9, 6, 3$. As you can see, it is pseudo-random-ish. With larger, well-chosen values of $r$ and $s$ the relationship between the numbers is less obvious.



      I have two questions about this:



      First, does this formula have a name (and if so, what is it)?



      Second, what is the proper term for this type of sequence? I've tried searching with variations on "nonrepeating cyclic sequence" but not found what I'm looking for. The main characteristic that I'm looking for is that the numbers in the sequence must not repeat until all of the numbers in the range have been output. Ultimately, I'd like to find sequences where the relationship between the numbers is not obvious (pseudo-random).









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Jul 23 at 21:04









      Jack A.

      1012




      1012

























          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f2860775%2fwhat-is-the-correct-term-for-a-nonrepeating-cyclic-sequence%23new-answer', 'question_page');

          );

          Post as a guest



































          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%2f2860775%2fwhat-is-the-correct-term-for-a-nonrepeating-cyclic-sequence%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?