Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Fibonacci numbers

by jeroenes (Priest)
on Oct 02, 2001 at 00:54 UTC ( #115976=note: print w/replies, xml ) Need Help??


in reply to Fibonacci numbers

Yes.

Replies are listed 'Best First'.
Re: Re: Fibonacci numbers
by dga (Hermit) on Oct 02, 2001 at 00:57 UTC

    I agree with jeroenes. This is very possible to do.

      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
Node Status?
node history
Node Type: note [id://115976]
help
Chatterbox?
Discipulus new german hymn: ♪♫ Jamiaca eha, afriki le, Jamaica eha..

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-09-24 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?