Generate distinct prime factors and the number of distinct factors.

For example, the complete prime factorization of 1000000 is:

2 * 2 * 2 * 2 * 2 * 2 * 5 * 5 * 5 * 5 * 5 * 5

The distinct prime factors are 2 and 5, and the number of distinct factors is 2.

The number of distinct prime factors is the subject of the Erdős–Kac theorem. They are denoted ω(n). So ω(1000000) = 2.

New and Improved Version

Additions by Klaus Q. Fischer

This new version has several improvements. The most notable change is that it shows the exponent for each prime factor. So, for example, the distinct factors of 500 are now represented thus:

500: 2 = 2,2 * 5,3

This can be read as "500 has 2 distinct factors: 2 (squared) and 5 (cubed)". (The full notation would be 2 * 2 * 5 * 5 * 5.)

Output composites and their prime factors in a selected range to text files.

Save the program (PFactors.exe or DFactors.exe) to a folder.

Specify From and To values.

Select the range (number of values*) for each text file.

Click Start.

What you get?

PFactors.exe
The first number is the composite and the remaining numbers are its prime factors. (For example, 693 = 11 * 7 * 3 * 3 shows the unique prime factorization of 693. The same factor is shown as many time as required to create the sum.)

DFactors2.exe (new version)
The first number is the composite; the second number is the number of distinct prime factors; the pairs of comma-separated numbers are the distinct prime factors and their exponents. (For example, 693: 3 = 3,2 * 7,1 * 11,1 means that for 693 there are 3 distinct prime factors and that prime factor 3 is squared.)

DFactors.exe (original version)
The first number is the composite; the comma-separated numbers are the distinct prime factors; the third number is the number of distinct factors. (For example, 693: 3,7,11 : 3 means that for 693 there are 3 distinct prime factors.)

*If you accept the default of 100,000, that means 100,000 values (and lines) will be written to each file.