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.