One way to represent a natural number is by multiplying exponents of prime numbers. For example, 6 can be represented by 2^1*3^1, and 50 can be represented by 2^1*5^2 (where ^ indicates exponention). The number of primes in this representation can help determine whether it is shorter to use this method of representation, compared to other methods. But because I don't want to calculate these by hand, I need a program to do it for me. However, because I'll have to remember the program until I get home, it needs to be as short as possible.
Write a program or function to determine how many distinct primes there are in this representation of a number.
An integer n such that 1 < n < 10^12, taken by any normal method.
The number of distinct primes that are required to represent the input, as outlined in the introduction.
24 -> 2 (2^3*3^1) 126 -> 3 (2^1*3^2*7^1) 1538493 -> 4 (3^1*11^1*23^1*2027^1) 123456 -> 3 (2^6*3^1*643^1)
This is OEIS A001221.
This is code-golf, lowest score in bytes wins!