Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Recamán's sequence and memory usage

by Athanasius (Archbishop)
on Jul 13, 2015 at 08:41 UTC ( [id://1134465]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    R(0)  = 0;
    for n > 0,
        R(n) = R(n-1) - n if positive and not already in the sequence, oth
    +erwise
        R(n) = R(n-1) + n.
    
  2. or download this
    use strict;
    use warnings;
    ...
            last;
        }
    }
    
  3. or download this
    14:20 >perl recaman.pl
    1 <-- 1
    ...
    4 <-- 131
    19 <-- 99734
    ...
    
  4. or download this
    use strict;
    use warnings;
    ...
        int_handler();
        exit 0;
    }
    
  5. or download this
    14:20 >perl -v
    
    This is perl 5, version 22, subversion 0 (v5.22.0) built for MSWin32-x
    +64-multi-thread
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1134465]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found