While working on my TrellOps module, one of the things I needed was a way to teach people the Fibonacci sequence.
So whenever in doubt, I told them to use this little function 🙂
1 2 3 4 5 6 7 8 |
function Get-Fibonacci ([int32]$m) { $c,$p = 1 while ($c -le $m) { $c $c,$p = ($c + $p),$c } } Get-Fibonacci 50 |