Re: Find (cyclic) Sequence

• To: mathgroup at smc.vnet.net
• Subject: [mg109352] Re: Find (cyclic) Sequence
• From: mokambo <alexandrepassosalmeida at gmail.com>
• Date: Fri, 23 Apr 2010 03:47:45 -0400 (EDT)
• References: <hqou0k\$9fp\$1@smc.vnet.net> <hqp99h\$grb\$1@smc.vnet.net>

```On Apr 22, 11:44 am, Albert Retey <a... at gmx-topmail.de> wrote:
> Hi,
>
> > 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?
>
> I think you would just need to repeat your sequence to make Mathematica
> understand, obviously the task for FindSequenceFunction is a easier when
> the sequences you feed it are longer:
>
> FindSequenceFunction[{0, 4, 3, 2, 1, 0, 4, 3, 2, 1}]
>
> gives:
>
> Mod[1 + 4 #1, 5] &
>
> hth,
>
> albert

Ok, but

FindSequenceFunction[{0, 3, 2, 1, 0, 3, 2, 1}]

really gives:

Mod[1 + 3 #1 + 2 #1^2 + 2 #1^3, 4] &

because of 1-based indexing. The alternative is to specify

FindSequenceFunction[Table[{k, Mod[4 - k, 4]}, {k, 0, 7}]]

resulting in

Mod[#1 (13 + 2 #1^2), 4] &

Now, how is this reduced to the cleaner 4-k?

```

• Prev by Date: Re: How to make make a Dynamic variable to become an ordinary one
• Next by Date: Re: Unevaluated functions
• Previous by thread: Re: Find (cyclic) Sequence
• Next by thread: Re: Find (cyclic) Sequence