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.

A284256 a(n) = number of prime factors of n that are > the square of smallest prime factor of n (counted with multiplicity), a(1) = 0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Mar 24 2017

Keywords

Examples

			For n = 10 = 2*5, there is a single prime factor 5 that is > 2^2, thus a(10) = 1.
For n = 15 = 3*5, there are no prime factors larger than 3^2, thus a(15) = 0.
For n = 50 = 2*5*5, the prime factors larger than 2^2 are 5*5, thus a(50) = 2.
		

Crossrefs

Cf. A251726 (gives the positions of zeros after the initial a(1)=0).

Programs

  • Mathematica
    Table[If[n == 1, 0, Count[#, d_ /; d > First[#]^2] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ n]], {n, 120}] (* Michael De Vlieger, Mar 24 2017 *)
  • PARI
    A(n) = if(n<2, return(1), my(f=factor(n)[, 1]); for(i=2, #f, if(f[i]>f[1]^2, return(f[i]))); return(1));
    a(n) = if(A(n)==1, 0, 1 + a(n/A(n)));
    for(n=1, 150, print1(a(n),", ")) \\ Indranil Ghosh, after David A. Corneth, Mar 24 2017
    
  • Python
    from sympy import primefactors
    def A(n):
        pf = primefactors(n)
        if pf: min_pf2 = min(pf)**2
        for i in pf:
            if i > min_pf2: return i
        return 1
    def a(n): return 0 if A(n)==1 else 1 + a(n//A(n))
    print([a(n) for n in range(1, 151)]) # Indranil Ghosh, Mar 24 2017

Formula

If A284252(n) = 1, a(n) = 0, otherwise a(n) = 1 + a(A284253(n)).
a(n) = A001222(A284254(n)).
a(n) = A001222(n) - A284257(n).