P is for Practical | |
PerlMonks |
Re^3: Golfing a fibonacci number generatorby jdalbec (Deacon) |
on Nov 04, 2006 at 00:36 UTC ( [id://582200]=note: print w/replies, xml ) | Need Help?? |
Since the (-phi)^(-n) term goes to zero quickly, it's enough to round (phi^n)/sqrt(5)to the nearest integer. 49 characters: die map{int(((1+($^=5**.5))/2)**$_/$^+.5).$/}0..9
In Section
Obfuscated Code
|
|