cp's OEIS Frontend

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.

A277885 a(n) = index of the least non-unitary prime divisor of n or 0 if no such prime-divisor exists.

This page as a plain text file.
%I A277885 #22 Nov 19 2024 22:11:43
%S A277885 0,0,0,1,0,0,0,1,2,0,0,1,0,0,0,1,0,2,0,1,0,0,0,1,3,0,2,1,0,0,0,1,0,0,
%T A277885 0,1,0,0,0,1,0,0,0,1,2,0,0,1,4,3,0,1,0,2,0,1,0,0,0,1,0,0,2,1,0,0,0,1,
%U A277885 0,0,0,1,0,0,3,1,0,0,0,1,2,0,0,1,0,0,0,1,0,2,0,1,0,0,0,1,0,4,2,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,2,0,0,1
%N A277885 a(n) = index of the least non-unitary prime divisor of n or 0 if no such prime-divisor exists.
%H A277885 Antti Karttunen, <a href="/A277885/b277885.txt">Table of n, a(n) for n = 1..10000</a>
%H A277885 <a href="https://oeis.org/wiki/Index_to_OEIS:_Section_Pri#prime_indices">Index entries for sequences computed from prime indices</a>.
%F A277885 a(1) = 0; for n > 1, if A067029(n) > 1, a(n) = A055396(n), otherwise a(n) = a(A028234(n)). [One may use A032742 instead of A028234 for recursing.]
%F A277885 A008578(1+a(n)) = A249739(n).
%F A277885 For n > 1, a(n) + A277697(n) > 0.
%t A277885 Table[PrimePi@ Min[Select[FactorInteger[n][[All, 1]], ! CoprimeQ[#, n/#] &] /. {} -> 0], {n, 120}] (* _Michael De Vlieger_, Nov 15 2016 *)
%o A277885 (Scheme) (definec (A277885 n) (cond ((= 1 n) 0) ((< 1 (A067029 n)) (A055396 n)) (else (A277885 (A028234 n)))))
%o A277885 (Python)
%o A277885 from sympy import factorint, primepi, isprime, primefactors
%o A277885 def a049084(n): return primepi(n)*(1*isprime(n))
%o A277885 def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
%o A277885 def a028234(n):
%o A277885     f = factorint(n)
%o A277885     return 1 if n==1 else n/(min(f)**f[min(f)])
%o A277885 def a067029(n):
%o A277885     f=factorint(n)
%o A277885     return 0 if n==1 else f[min(f)]
%o A277885 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 A277885 (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 A277885 Cf. A008578, A028234, A032742, A055396, A067029, A249739.
%Y A277885 Cf. A277697.
%Y A277885 Cf. A005117 (gives the positions of zeros).
%K A277885 nonn
%O A277885 1,9
%A A277885 _Antti Karttunen_, Nov 08 2016