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.

A240975 The number of distinct prime factors of n^3-1.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 4, 2, 2, 3, 2, 3, 3, 4, 2, 4, 3, 3, 2, 4, 3, 4, 3, 2, 3, 4, 4, 4, 2, 4, 3, 3, 3, 4, 3, 4, 4, 4, 3, 4, 2, 4, 3, 4, 2, 4, 4, 3, 4, 3, 3, 5, 2, 4, 4, 3, 3, 5, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 5, 2
Offset: 1

Views

Author

R. J. Mathar, Aug 05 2014

Keywords

Examples

			3^3-1 = 26 = 2*13, so a(3) = 2.
0 has no prime factors, so a(1) = 0.
		

Crossrefs

Programs

  • Maple
    A240975 := proc(n)
        A001221(n^3-1) ;
    end proc:
  • Mathematica
    a[n_] := PrimeNu[n^3-1]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Sep 13 2024 *)
  • PARI
    a(n) = if(n<=1,0,omega(n^3-1)); \\ Joerg Arndt, Aug 06 2014
  • Python
    from sympy import primefactors
    def A240975(n):
        return len(primefactors(n**3-1)) # Chai Wah Wu, Aug 06 2014
    

Formula

a(prime(n)) = A245909(n).
a(n) = A001221(A068601(n)) for n >= 2. - Michel Marcus, Aug 06 2014