What is the correct term for a nonrepeating cyclic sequence?
Clash 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).
sequences-and-series
add a comment |Â
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).
sequences-and-series
add a comment |Â
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).
sequences-and-series
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).
sequences-and-series
asked Jul 23 at 21:04
Jack A.
1012
1012
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password