OFFSET
1,10
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10001
FORMULA
a(k) > 1 iff k is in A251727. - David A. Corneth, Mar 25 2017
EXAMPLE
For n=10 = 2*5, the smallest prime divisor > 2^2 is 5, thus a(10) = 5.
For n=15 = 3*5, there are no prime divisors > 3^2, thus a(15) = 1.
For n=165 = 3*5*11, the smallest prime divisor > 3^2 is 11, thus a(165) = 11.
MATHEMATICA
a[n_] := Block[{p = First /@ FactorInteger[n]}, SelectFirst[p, # > p[[1]]^2 &, 1]]; Array[a, 120] (* Giovanni Resta, Mar 24 2017 *)
PROG
(Scheme) (define (A284252 n) (let ((spf1 (A020639 n))) (let loop ((n (/ n spf1))) (let ((spf2 (A020639 n))) (cond ((= 1 spf2) 1) ((> spf2 (* spf1 spf1)) spf2) (else (loop (/ n spf2))))))))
(PARI) a(n) = if(n==1, return(1), my(f=factor(n)[, 1]); s = f[1]; for(i=2, #f, if(f[i]>s^2, return(f[i]))); return(1)) \\ David A. Corneth, Mar 24 2017
(Python)
from sympy import primefactors
def a(n):
for i in primefactors(n):
if i>min(primefactors(n))**2: return i
return 1
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