Statistics

Problem Statement for "GoldConjecture"

Problem Statement

A famous mathematical conjecture states that all numbers greater than 5 can be expressed as the sum of 3 prime numbers. A number is prime if it is only evenly divisible by itself and 1. Furthermore, 2 is the lowest prime number. Given an integer k greater than 5, you will return the 3 prime numbers whose sum is k in increasing order. If there is more than one combination of three primes whose sum is k return the 3 primes with the highest product (i.e., the three primes multiplied together produces the highest value).

Definition

Class:
GoldConjecture
Method:
numbers
Parameters:
int
Returns:
int[]
Method signature:
int[] numbers(int k)
(be sure your method is public)

Constraints

  • k will be between 6 and 2000 inclusive
  • All given values of k will have solutions

Examples

  1. 10

    Returns: { 2, 3, 5 }

    2,3,5 is the only solution that works.

  2. 157

    Returns: { 43, 53, 61 }

  3. 12

    Returns: { 2, 5, 5 }

    2,3,7 and 2,5,5 both are primes that add up to 12 but: 2*3*7 = 42 2*5*5 = 50 So the solution is {2,5,5}

  4. 2000

    Returns: { 2, 977, 1021 }

  5. 1997

    Returns: { 659, 661, 677 }

  6. 777

    Returns: { 257, 257, 263 }

  7. 1234

    Returns: { 2, 613, 619 }

  8. 1987

    Returns: { 653, 661, 673 }

  9. 375

    Returns: { 113, 131, 131 }

  10. 6

    Returns: { 2, 2, 2 }

  11. 222

    Returns: { 2, 107, 113 }

  12. 111

    Returns: { 37, 37, 37 }

  13. 7

    Returns: { 2, 2, 3 }

  14. 11

    Returns: { 3, 3, 5 }

  15. 13

    Returns: { 3, 5, 5 }

  16. 799

    Returns: { 257, 271, 271 }

  17. 1997

    Returns: { 659, 661, 677 }

  18. 2000

    Returns: { 2, 977, 1021 }

  19. 82

    Returns: { 2, 37, 43 }

  20. 6

    Returns: { 2, 2, 2 }

  21. 1998

    Returns: { 2, 983, 1013 }

  22. 10

    Returns: { 2, 3, 5 }

  23. 1997

    Returns: { 659, 661, 677 }

  24. 2000

    Returns: { 2, 977, 1021 }

  25. 82

    Returns: { 2, 37, 43 }

  26. 6

    Returns: { 2, 2, 2 }

  27. 1998

    Returns: { 2, 983, 1013 }

  28. 561

    Returns: { 179, 191, 191 }

  29. 10

    Returns: { 2, 3, 5 }

  30. 1997

    Returns: { 659, 661, 677 }

  31. 2000

    Returns: { 2, 977, 1021 }

  32. 82

    Returns: { 2, 37, 43 }

  33. 6

    Returns: { 2, 2, 2 }

  34. 1998

    Returns: { 2, 983, 1013 }

  35. 561

    Returns: { 179, 191, 191 }

  36. 10

    Returns: { 2, 3, 5 }


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: