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;
      }