Distinct primes factors The first two consecutive numbers to have two distinct prime factors are: 14 = 2 × 7 15 = 3 × 5 The first three consecutive numbers to have three distinct prime factors are: 644 = 2² × 7 × 23 645 = 3 × 5 × 43 646 = 2 × 17 × 19. Find the first four consecutive integers to have four distinct prime factors. What is the first of these numbers? I have written a direct solution for this problem. Solution which you can see below, uses prime factorization as the base concept. All the remaining things are simple and easy. You can see further explanation in the program section. Program File: pep47.py ------------------------- # http://radiusofcircle.blogspot.com # time module import time # time at the start of program execution start = time.time() def npf(number): """function which will return the number of prime factors""" i = 2 a = set() while i We have created npf function an ab...
With Radius of Circle, people can learn to program and have hands-on tutorials with python and Matlab. ProjectEuler problems solutions are also available to have a better solution and improve the knowledge of people. A lot of algorithms which form the basic programming are also available. I hope the internet community will make use of this blog.