in reply to Re^2: Fibonacci Sequence
in thread Fibonacci Sequence
$"++;_:while(++$"){$"%$_||next(_)for 2..$"-1;print$",$/}
Update: trizen has pointed out that this is more efficient:
$"++;_:while(++$"){$"%$_||next(_)for 2..sqrt$";print$",$/}
... but I don't like the two extra keystrokes required. Meanwhile, this solution gives you a minor efficiency boost without any extra nasty keystroke things...
$"++;_:while(++$"){$"%$_||next(_)for 2..$"/2;print$",$/}
|
|---|