$count = 8 $answer = @(0,1) 0..($count - $answer.Length) | Foreach { $answer += $answer[-1] + $answer[-2] } $answer