Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Golfing a fibonacci number generator

by jdalbec (Deacon)
on Nov 04, 2006 at 00:36 UTC ( [id://582200]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Golfing a fibonacci number generator
in thread Golfing a fibonacci number generator

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582200]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found