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

//Me again// Wow, I like that one alot :) I think that might be the best one I've seen. I figured most people would try to go for the 'add the previous to the next' method, so I put the phi/-phi formula to use.
Thanks for the help! It's getting close to the lowest it can get, I'd think, because of the necessary bulk of the forumla itself. 67 characters, not bad! :D I appreciate the feedback.
  • Comment on Re^2: Golfing a fibonacci number generator

Replies are listed 'Best First'.
Re^3: Golfing a fibonacci number generator
by jdalbec (Deacon) on Nov 04, 2006 at 00:36 UTC

    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