%I #12 May 17 2017 17:54:17
%S 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,
%T 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,
%U 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
%N a(n) = Least prime divisor of n with an odd exponent, or 1 if n is a perfect square.
%H Antti Karttunen, <a href="/A277708/b277708.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A008578(1+A277707(n)).
%F a(n) = A020639(A007913(n)).
%o (Scheme, two different implementations)
%o (define (A277708 n) (A008578 (+ 1 (A277707 n))))
%o (define (A277708 n) (A020639 (A007913 n)))
%o (PARI) a(n) = my(f = factor(core(n))); if (!#f~, 1, vecmin(f[,1])); \\ _Michel Marcus_, Oct 30 2016
%o (Python)
%o from sympy import primefactors
%o from sympy.ntheory.factor_ import core
%o def lpf(n): return 1 if n==1 else primefactors(n)[0]
%o def a(n): return lpf(core(n)) # _Indranil Ghosh_, May 17 2017
%Y Cf. A020639, A007913, A008578, A277707.
%Y Cf. A000290 (after its initial zero-term gives the positions of ones in this sequence).
%Y Cf. also A277698.
%K nonn
%O 1,2
%A _Antti Karttunen_, Oct 28 2016