A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.
A000040 The prime numbers.
Every positive integer n > 1 can be represented in exactly one way as a product of prime powers.
\[n=\prod_{p\epsilon \mathbb{P} }^{\infty}{p}^{\alpha_{n} }\]
\[n=60=2^{2}\cdot 3\cdot 5\]
\[15=3\times 5=3^{1}\times5^{1}\]
\[30=2\times 3\times5=2^{1}\times3^{1}\times5^{1}\]
\[60=2\times 2\times 3\times 5=2^{2}\times3^{1}\times5^{1}\]
\[299792458 = 2 \times 7 \times 73 \times 293339\]
\[299792458^{2} = 89875517873681764 \\ =2^{2} \times 7^{2} \times 73^{2} \times 293339^{2}\]
A124010 Exponents in factorization of n.
A027748 Lists distinct prime factors of n.
A027746 Lists prime factors of n with repetition.
A030231 Even number of distinct primes.
A030230 Odd number of distinct primes.
\[\Omega (n)\]
\[\Omega (n)=\sum_{p\epsilon \mathbb{P}}^{\infty}\alpha _{n}\]
Number of prime divisors of n counted with repetition.
A001222 Counted with multiplicity
\[\omega (n)\]
Number of distinct primes dividing n.
A001221 Counted without repetition
Obviously for a prime $p$ it follows that $\omega(p) = 1$.
When $n$ is a squarefree number then $\Omega(n) = \omega(n)$.
Otherwise $\Omega(n) > \omega(n)$.
$\omega(n)$ is an additive function, and it can be used to define a multiplicative function like the Möbius's function :
$\mu(n) = (-1)^{\omega(n)}$ (as long as n is squarefree).
A005117 Squarefree numbers.
A020639 Lpf(n): least prime dividing n.
A007947 Largest squarefree number.
A006530 Gpf(n): greatest prime dividing n.
A008472 Sum of distinct primes dividing n.
table([(n,factor(n)) for n in [1..60]], header_row=['n', 'Factorization of n'])
L = [factor(n) for n in range(1, 60)]
print L
#
n=2520
# Factorization
factor(n)
#list of prime factors with exponents
list(factor(n))
#number of prime factors
len(factor(n))
f = factor(n); f
[p^e for p,e in f]
[p for p,e in f]
[e for p,e in f]
import numpy as np
L = np.array([p^e for p,e in f])
list(L).count(1)
from collections import Counter
Counter(L)
2^3 * 3^2 * 5 * 7
[(2, 3), (3, 2), (5, 1), (7, 1)]
4
2^3 * 3^2 * 5 * 7
[8, 9, 5, 7]
[2, 3, 5, 7]
[3, 2, 1, 1]
0
Counter({8: 1, 9: 1, 5: 1, 7: 1})
n=2520
f = factor(n); f
[p^e for p,e in f]
#A001221
len([p for p,e in f])
#A001222
sum([e for p,e in f])
2^3 * 3^2 * 5 * 7
[8, 9, 5, 7]
4
7
n=2520
prime_divisors(n)
[2, 3, 5, 7]