Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (16)
As of 2014-08-21 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls