This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A277707 #16 May 17 2017 17:54:11 %S A277707 0,1,2,0,3,1,4,1,0,1,5,2,6,1,2,0,7,1,8,3,2,1,9,1,0,1,2,4,10,1,11,1,2, %T A277707 1,3,0,12,1,2,1,13,1,14,5,3,1,15,2,0,1,2,6,16,1,3,1,2,1,17,2,18,1,4,0, %U A277707 3,1,19,7,2,1,20,1,21,1,2,8,4,1,22,3,0,1,23,2,3,1,2,1,24,1,4,9,2,1,3,1,25,1,5,0,26,1,27,1,2 %N A277707 a(n) = index of the least prime divisor of n which has an odd exponent, or 0 if n is a perfect square. %H A277707 Antti Karttunen, <a href="/A277707/b277707.txt">Table of n, a(n) for n = 1..10000</a> %H A277707 <a href="https://oeis.org/wiki/Index_to_OEIS:_Section_Pri#prime_indices">Index entries for sequences computed from prime indices</a> %F A277707 a(1) = 0; for n > 1, if A067029(n) is odd, then a(n) = A055396(n), otherwise a(n) = a(A028234(n)). %F A277707 a(n) = A055396(A007913(n)). %e A277707 For n = 8 = 2*2*2 = prime(1)^3, the exponent of the least (and the only) prime factor 2 is 3, an odd number, thus a(8) = 1 as 2 = prime(1). %o A277707 (Scheme, two implementations) %o A277707 (definec (A277707 n) (cond ((= 1 n) 0) ((odd? (A067029 n)) (A055396 n)) (else (A277707 (A028234 n))))) %o A277707 (define (A277707 n) (A055396 (A007913 n))) %o A277707 (PARI) a(n) = my(f = factor(core(n))); if (!#f~, 0, primepi(vecmin(f[,1]))); \\ _Michel Marcus_, Oct 30 2016 %o A277707 (Python) %o A277707 from sympy import primepi, isprime, primefactors %o A277707 from sympy.ntheory.factor_ import core %o A277707 def a049084(n): return primepi(n)*(1*isprime(n)) %o A277707 def a055396(n): return 0 if n==1 else a049084(min(primefactors(n))) %o A277707 def a(n): return a055396(core(n)) # _Indranil Ghosh_, May 17 2017 %Y A277707 Cf. A007913, A028234, A055396, A067029. %Y A277707 Cf. A000290 (after its initial zero-term gives the positions of zeros in this sequence). %Y A277707 Cf. also A277708, A277697. %K A277707 nonn %O A277707 1,3 %A A277707 _Antti Karttunen_, Oct 28 2016