my ($a,$b)=(1,2); # Start sequence at 1,2 like in code print "$a\n$b\n"; for(1..$n-2) { ($a,$b) = ($b,$a+$b); print "$b\n" }