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

Re: Triangle Numbers Revisited

by hv (Parson)
on Oct 14, 2004 at 12:47 UTC ( #399183=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      T_n == 1 (mod 3) when n == 1 (mod 3)
      T_n == 0 (mod 3) otherwise
    
  2. or download this
      if n == 0 (mod 3), require A A A or B B B
      if n == 1 (mod 3), require A A B
      if n == 2 (mod 3), require A B B
    
  3. or download this
      sub p_tri {
        my $num = shift;
    ...
        my $t = int((sqrt($x) + 1)/2);
        return +((2 * $t - 1) * (2 * $t - 1) == $x) ? 0 : --$t;
      }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://399183]
help
Chatterbox?
[hippo]: Trolls are trolls.
[Eily]: Discipulus sadly the CSS solution to ignore him isn't very effective when he answers the thread you want to read ...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-11-24 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (347 votes). Check out past polls.

    Notices?