Re: Find (cyclic) Sequence

*To*: mathgroup at smc.vnet.net*Subject*: [mg109348] Re: Find (cyclic) Sequence*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Fri, 23 Apr 2010 03:47:01 -0400 (EDT)

You are looking for a solution of the form f[a_, b_] = Mod[a + b*#, 4] &; seqIn = {0, 3, 2, 1}; seqOut = {0, 1, 2, 3}; sol = Reduce[ Thread[ f[a, b] /@ seqIn == seqOut], {a, b}, Integers] Element[C[1] | C[2], Integers] && a == 4*C[1] && b == 4*C[2] + 3 Picking values for the arbitrary constants sol /. {C[1] -> 1, C[2] -> -1} a == 4 && b == -1 Verifying f[4, -1] /@ seqIn == seqOut True Bob Hanlon ---- mokambo <alexandrepassosalmeida at gmail.com> wrote: ============= Dear Group: Consider the following sequence {0,3,2,1} which can be related to the reference k: {0,1,2,3} as 4-k (mod 4). I've tried to use FindSequenceFunction on problems like the example above without success. I understand I'm working within the context of modular arithmetic... Does anyone have a suggestion on how to use Mathematica to tackle this problem? Alex