Statistics

Problem Statement for "PrimeNumbers"

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)

Constraints

    Examples


      This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
      This problem was used for: