Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Triangle Numbers Revisited

by hv (Prior)
on Oct 14, 2004 at 12:47 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://399183]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found