Message Boards Message Boards

0
|
4661 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Enumerate all periodic sequences of some linear recurrences?

For scientific purposes (code research) I am using Mathematica to enumerate all periodic sequences of some linear recurrences. As an example the command

Table[{Mod[i * 2^n + j * 4^n + k * 6^n, 7]},{i, 0, 5\}, {j, 0,   5}, {k, 0, 5}, {n, 0, 5}]

allows to enumerate all 216 distinct linear recurrent sequences in a finite field of order 7 (or mod 7) with characteristic polynomial whose roots are 2,4 and 6. The first five sequences it produces are:

{0, 0, 0, 0, 0, 0}, {1, 6, 1, 6, 1, 6}, {2, 5, 2, 5, 2, 5}, {3, 4, 3, 4, 3, 4}, {4, 3, 4, 3, 4, 3}, …

I have two questions:

i) The first sequence is obtained when i=0,j=0,k=0; the second when i=0,j=0,k=1, the third when i=0,j=0,k=2, etc. Is there a way to join these numbers with the sequence they generate so that I will know these parameters and therefore to be able to, later (if needed), generate a particular sequence? That is I would like that the output would be something like this

{{0, 0, 0, 0, 0, 0},{0,0,0}},  {{1, 6, 1, 6, 1, 6},{0,0,1}},  {{2, 5, 2, 5, 2, 5},{0,0,2}} , etc.

ii) In the example above (3rd order linear recurrence, and mod 7) the number of sequences obtained (216) is manageable by hand; but this number grows very quickly when the linear recurrence has order higher than 3 and the field has characteristic higher than 7. And, in those cases, most of the sequences that are produced are of no interest to me. I think that I could throw away at least 99% of the sequences that do not interest me if I could add a command that would read the output (the sequences obtained) and would say “I only want the sequences such that the products of its elements is 216 (say)”: from the five sequences above only {1, 6, 1, 6, 1, 6} would remain because 1 x6x1x6x1x6 = 216; or “I only want the sequences such that the products of its elements is 216 or 1000 (say)” from the five sequences above {1, 6, 1, 6, 1, 6} and {2, 5, 2, 5, 2, 5} would remain because 1x6x1x6x1x6 = 216 and 2x5x2x 5x2x 5=1000.

Is it possible to do this?

Thank you in advance.

POSTED BY: Joaquim Nogueira
3 Replies

Everything is an expression in Mathematica. If you imagine that you're using commands, you'll thoroughly misunderstand what's going on.

In particular, the first argument of Table can be pretty much any expression at all. So, make it a list of all the things you want to tabulate together:

Table[{Mod[i*2^n + j*4^n + k*6^n, 7], {i, j, k}}, ...

Now, the result is:

{{{{{0, {0, 0, 0}}, {0, {0, 0, 0}}, {0, {0, 0, 0}}}, {{1, {0, 0, 1}}, {6, {0, 0, 1}}, 
{1, {0, 0, 1}}}, {{2, {0, 0, 2}}, {5, {0, 0, 2}}, {2, {0, 0, 2}}}}, ...
POSTED BY: John Doty
Posted 6 years ago
POSTED BY: Updating Name

Thank you. I will try these instructions and see if they can be adapted to my needs.

By the way the reason I was checking the product of the elements of these sequences was because I am trying to find if they belong to a multiplicative group. As I know beforehand the multiplicative groups that exist mod 7, or mod 11, or mod 13, etc. I also know what is the result obtained when multiplying their elements; call M such a number. So, if I search sequences such that when I multyply their elements I obtain the number M, this sequence (as a set) is a good candidate to be a group, and thus I must check it more carefully.

POSTED BY: Joaquim Nogueira
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract