Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

(Efficiency Golf) Triangular numbers

by jepri (Parson)
on May 30, 2001 at 09:08 UTC ( #84175=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $n (1..1000) {
     $x=.5*$n*($n+1);
     print $x;
    }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
     } until $x > $num;
     return 0;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://84175]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2014-09-19 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls