login
A381205
a(n) is the cardinality of the set of bases and exponents (including exponents = 1) in the prime factorization of n.
0
0, 2, 2, 1, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 1, 3, 2, 4, 2, 2, 3, 3, 3, 2, 2, 3, 3, 4, 2, 4, 2, 3, 4, 3, 2, 4, 2, 3, 3, 3, 2, 3, 3, 4, 3, 3, 2, 4, 2, 3, 4, 2, 3, 4, 2, 3, 3, 4, 2, 2, 2, 3, 4, 3, 3, 4, 2, 4, 2, 3, 2, 4, 3, 3, 3, 4, 2, 4
OFFSET
1,2
COMMENTS
The prime factorization of 1 is the empty set, so a(1) = 0 by convention.
EXAMPLE
a(16) = 2 because 12 = 2^3, the set of these bases and exponents is {2, 3} and its size is 2.
a(31500) = 5 because 31500 = 2^2*3^2*5^3*7^1, the set of these bases and exponents is {1, 2, 3, 5, 7} and its size is 5.
MAPLE
a:= n-> nops({map(i-> i[], ifactors(n)[2])[]}):
seq(a(n), n=1..90); # Alois P. Heinz, Feb 18 2025
MATHEMATICA
A381205[n_] := If[n == 1, 0, Length[Union[Flatten[FactorInteger[n]]]]];
Array[A381205, 100]
PROG
(PARI) a(n) = my(f=factor(n)); #setunion(Set(f[, 1]), Set(f[, 2])); \\ Michel Marcus, Feb 18 2025
(Python)
from sympy import factorint
def a(n): return len(set().union(*(set(pe) for pe in factorint(n).items())))
print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Feb 18 2025
CROSSREFS
Cf. A051674 (positions of ones), A381201, A381202, A381203, A381204, A381212.
Sequence in context: A216817 A263765 A335424 * A270073 A027348 A238325
KEYWORD
nonn,easy,new
AUTHOR
Paolo Xausa, Feb 17 2025
STATUS
approved