Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Math Topics » discretemath

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Wouter Meeussen

Posts: 5
Registered: 2/25/12
Re: Recurrence Relations
Posted: Mar 27, 2012 2:43 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.