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 A277697 #20 Jul 28 2024 03:37:20 %S A277697 0,1,2,0,3,1,4,0,0,1,5,2,6,1,2,0,7,1,8,3,2,1,9,2,0,1,0,4,10,1,11,0,2, %T A277697 1,3,0,12,1,2,3,13,1,14,5,3,1,15,2,0,1,2,6,16,1,3,4,2,1,17,2,18,1,4,0, %U A277697 3,1,19,7,2,1,20,0,21,1,2,8,4,1,22,3,0,1,23,2,3,1,2,5,24,1,4,9,2,1,3,2,25,1,5,0,26,1,27,6,2 %N A277697 a(n) = index of the least unitary prime divisor of n or 0 if no such prime-divisor exists. %H A277697 Antti Karttunen, <a href="/A277697/b277697.txt">Table of n, a(n) for n = 1..10000</a> %H A277697 <a href="https://oeis.org/wiki/Index_to_OEIS:_Section_Pri#prime_indices">Index entries for sequences computed from prime indices</a>. %F A277697 a(1) = 0; for n > 1, if A067029(n) = 1, then a(n) = A055396(n), otherwise a(n) = a(A028234(n)). %e A277697 For n = 8 = 2*2*2, none of the prime divisors are unitary, thus a(8) = 0. %e A277697 For n = 20 = 2*2*5 = prime(1)^2 * prime(3), the prime divisor 2 is not unitary, but 5 (= prime(3)) is, thus a(20) = 3. %e A277697 For n = 36 = 2*2*3*3, none of the prime divisors are unitary, thus a(36) = 0. %t A277697 Table[If[Length@ # == 0, 0, PrimePi@ First@ #] &@ Select[FactorInteger[n][[All, 1]], GCD[#, n/#] == 1 &], {n, 105}] (* _Michael De Vlieger_, Oct 30 2016 *) %o A277697 (Scheme) (definec (A277697 n) (cond ((= 1 n) 0) ((= 1 (A067029 n)) (A055396 n)) (else (A277697 (A028234 n))))) %o A277697 (Python) %o A277697 from sympy import factorint, primepi, isprime, primefactors %o A277697 def a049084(n): return primepi(n)*(1*isprime(n)) %o A277697 def a055396(n): return 0 if n==1 else a049084(min(primefactors(n))) %o A277697 def a028234(n): %o A277697 f = factorint(n) %o A277697 return 1 if n==1 else n/(min(f)**f[min(f)]) %o A277697 def a067029(n): %o A277697 f=factorint(n) %o A277697 return 0 if n==1 else f[min(f)] %o A277697 def a(n): return 0 if n==1 else a055396(n) if a067029(n)==1 else a(a028234(n)) # _Indranil Ghosh_, May 15 2017 %o A277697 (PARI) a(n) = {my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] == 1, return(primepi(f[i, 1])))); 0;} \\ _Amiram Eldar_, Jul 28 2024 %Y A277697 Cf. A028234, A055396, A067029. %Y A277697 Cf. A001694 (positions of zeros). %Y A277697 Cf. also A080368, A277698, A277707. %K A277697 nonn %O A277697 1,3 %A A277697 _Antti Karttunen_, Oct 28 2016