
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?

