OFFSET
1,50
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10001
FORMULA
EXAMPLE
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.
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 *)
PROG
(Scheme, with memoization-macro definec)
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 24 2017
STATUS
approved