Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Fibonacci numbers

by premchai21 (Curate)
on Oct 02, 2001 at 01:04 UTC ( [id://115981]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Fibonacci numbers
in thread Fibonacci numbers

Yes, it is. To reduce the problem size, the following program is likely to eventually print out any Fibonacci numbers between 0 and N-1, where N is the command line argument. In order, even. However, you must find them buried in all the other numbers, and it will take an indeterminate amount of time. It will not stop upon hitting a sequence of fibonacci numbers. (Hint: The output is random.)
#!/usr/bin/perl -w use strict;my$N=$_[0];$\=' ';for (;;){print int rand$N}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found