TopCoder problem "PrimeNumbers" used in SRM 1 (Division I Level Three , Division II Level Three)



Problem Statement

    
Implement a class PrimeNumbers that contains a method pairwisePrimes.  The
method inputs an int (num) and returns the number of ways the number can be
written as the sum of three distinct integers that are pairwise relatively
prime; that is no pair of the three integers has a common factor greater than 1.

Note:

- num is greater than 0 and less than or equal to 40.
- One of the three distinct integer can be 1; Numbers are Pairwise Relatively
Prime if they share no factor GREATER than 1.

Method Signature:

public int pairwisePrimes( int );

Examples:

For num=8:  8 can be written as 1+2+5 and 1+3+4 and the method should return 2.
For num=18, the method should return 14
 

Definition

    
Class:PrimeNumbers
Method:pairwisePrimes
Parameters:int
Returns:int
Method signature:int pairwisePrimes(int param0)
(be sure your method is public)
    

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=54

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=3000&pm=54

Writer:

Unknown

Testers:

Problem categories: