Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Recurrence Relations
Replies: 4   Last Post: Apr 3, 2012 2:42 AM

 Messages: [ Previous | Next ]
 Wouter Meeussen Posts: 6 Registered: 2/25/12
Re: Recurrence Relations
Posted: Mar 27, 2012 2:43 PM

it's 1.

in Mma 4.1:

Clear[f];
f[0] := 1; f[1] := 2; f[n_] := f[n] = f[n - 2] + f[n - 1]^2

Mod[f /@ Range[12],7]
{2, 5, 6, 6, 0, 6, 1, 0, 1, 1, 2, 5}

\$RecursionLimit = 2010;
Clear[g]; g[0] := 1; g[1] := 2;
g[n_] := g[n] = Mod[Mod[g[n - 2], 7] + Mod[g[n - 1], 7]^2, 7]

g /@ Range[12]
{2, 5, 6, 6, 0, 6, 1, 0, 1, 1, 2, 5}

g[2009]
1

g /@ Range[2001, 2012]
{2, 5, 6, 6, 0, 6, 1, 0, 1, 1, 2, 5}

(*hope I didn't spoil your teacher's homework plans*)

Wouter.

- -----Original Message-----
From: Toni
Sent: Tuesday, March 27, 2012 5:35 PM
To: discretemath@mathforum.org
Subject: Recurrence Relations

f(n+2)=f(n)+(f(n+1))^2, f(0)=1, f(1)=2

f(2009) mod 7?

Date Subject Author
3/27/12 Toni
3/27/12 Wouter Meeussen
3/29/12 Toni
3/29/12 Angela Richardson
4/3/12 Toni