Replace command-line argument 12 with any positive integer N to get the Nth Fibonacci number. Starts getting pretty slow for me after N=30, by the nature of the algorithm.perl -le'$;=3;$;=~s/./$&?30:3/eg for 3..pop;print length$;' 12
Can you see how it works?
<Reveal this spoiler or all in this thread>
blokhead
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fibonacci numbers using regexes (threes are wild)
by Anonymous Monk on Nov 29, 2009 at 06:23 UTC | |
Re: Fibonacci numbers using regexes (threes are wild)
by pmonk4ever (Friar) on Dec 01, 2009 at 00:35 UTC | |
by blokhead (Monsignor) on Dec 01, 2009 at 04:10 UTC | |
by pmonk4ever (Friar) on Dec 01, 2009 at 17:46 UTC |
Back to
Obfuscated Code