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?
blokhead
In reply to Fibonacci numbers using regexes (threes are wild) by blokhead
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |