cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A381205 a(n) is the cardinality of the set of bases and exponents (including exponents = 1) in the prime factorization of n.

Original entry on oeis.org

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

Views

Author

Paolo Xausa, Feb 17 2025

Keywords

Comments

The prime factorization of 1 is the empty set, so a(1) = 0 by convention.

Examples

			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.
		

Crossrefs

Cf. A051674 (positions of ones), A381201, A381202, A381203, A381204, A381212.

Programs

  • 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]
  • 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