OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10001
FORMULA
EXAMPLE
For n = 50 = 2*5*5, only prime less than 2^2 is 2, thus a(50) = 2.
For n = 90 = 2*3*3*5, the primes less than 2^2 are 2, 3 and 3, thus a(90) = 2*3*3 = 18.
MATHEMATICA
Table[If[n == 1, 1, Function[d, First[Select[Reverse@ First@ d, Times @@ Boole@ Map[# < Last[d]^2 &, FactorInteger[#][[All, 1]]] == 1 &] /. {} -> {1}]]@ {#, First@ Select[#, PrimeQ]} &@ Divisors@ n], {n, 102}] (* Michael De Vlieger, Mar 24 2017 *)
PROG
(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, 1, A(n)*a(n/A(n)));
for(n=1, 150, print1(n/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 1 if A(n)==1 else A(n)*a(n//A(n))
print([n//a(n) for n in range(1, 151)]) # Indranil Ghosh, Mar 24 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 24 2017
STATUS
approved