Please show your attempt that didn't work. What do you do for Z(1)? (You could try looking at the help on filter) -- View this message in context: http://n4.nabble.com/Help-I-need-to-use-R-to-calculate-a-recursive-function-tp1586189p1586777.html Sent from the R help mailing list archive at Nabble.com.