Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 48
# Given that A, B and C are three prime numbers that are less than 1000. # Find A, B and C such that A x B x C= 238213091. all_prime_list = [num for num in range(1000) if is_prime(num)] def find_three_prime(answer): for first in all_prime_list: for second in all_prime_list: for third in all_prime_list: if first * second * third == answer: return first, second, third return 0, 0, 0 # first, second, third = find_three_prime(238213091) print 'The three prime numbers are %d, %d and %d.' % (first, second, third)
The three prime numbers are 349, 773 and 883.