A277708 a(n) = Least prime divisor of n with an odd exponent, or 1 if n is a perfect square.
1, 2, 3, 1, 5, 2, 7, 2, 1, 2, 11, 3, 13, 2, 3, 1, 17, 2, 19, 5, 3, 2, 23, 2, 1, 2, 3, 7, 29, 2, 31, 2, 3, 2, 5, 1, 37, 2, 3, 2, 41, 2, 43, 11, 5, 2, 47, 3, 1, 2, 3, 13, 53, 2, 5, 2, 3, 2, 59, 3, 61, 2, 7, 1, 5, 2, 67, 17, 3, 2, 71, 2, 73, 2, 3, 19, 7, 2, 79, 5, 1, 2, 83, 3, 5, 2, 3, 2, 89, 2, 7, 23, 3, 2, 5, 2, 97, 2, 11, 1, 101, 2, 103, 2, 3
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
PARI
a(n) = my(f = factor(core(n))); if (!#f~, 1, vecmin(f[,1])); \\ Michel Marcus, Oct 30 2016
-
Python
from sympy import primefactors from sympy.ntheory.factor_ import core def lpf(n): return 1 if n==1 else primefactors(n)[0] def a(n): return lpf(core(n)) # Indranil Ghosh, May 17 2017