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 A117371 #17 Sep 11 2018 17:03:03 %S A117371 0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,1,1,3,0,0,0,4,0,2,0,0,0,0,2,5, %T A117371 0,0,0,6,3,1,0,1,0,3,0,7,0,0,0,1,4,4,0,0,1,2,5,8,0,0,0,9,1,0,2,2,0,5, %U A117371 6,1,0,0,0,10,0,6,0,3,0,1,0,11,0,1,3,12,7,3,0,0,1,7,8,13,4,0,0,2,2,1,0,4,0 %N A117371 Number of primes between smallest prime divisor of n and largest prime divisor of n that are coprime to n (not factors of n). %C A117371 This sequence first differs from sequence A117370 at the 30th term. %H A117371 Antti Karttunen, <a href="/A117371/b117371.txt">Table of n, a(n) for n = 1..65537</a> %F A117371 a(n) = A001221(A137795(n)). - _Antti Karttunen_, Sep 10 2018 %e A117371 a(30) is 0 because the one prime (which is 3) between the smallest prime dividing 30 (which is 2) and the largest prime dividing 30 (which is 5) is not coprime to 30. On the other hand, a(14) = 2 because there are two primes (3 and 5) that are between 14's least prime divisor (2) and greatest prime divisor (7) and 3 and 5 are both coprime to 14. %p A117371 A020639 := proc(n) local ifs; if n = 1 then 1 ; else ifs := ifactors(n)[2] ; min(seq(op(1,i),i=ifs)) ; fi ; end: A006530 := proc(n) local ifs; if n = 1 then 1 ; else ifs := ifactors(n)[2] ; max(seq(op(1,i),i=ifs)) ; fi ; end: A117371 := proc(n) local a,i ; a := 0 ; if n < 2 then 0 ; else for i from A020639(n)+1 to A006530(n)-1 do if isprime(i) and gcd(i,n) = 1 then a := a+1 ; fi ; od; fi ; RETURN(a) ; end: seq(A117371(n),n=1..140) ; # _R. J. Mathar_, Sep 05 2007 %t A117371 Table[Count[Prime[Range[PrimePi@ First@ # + 1, PrimePi@ Last@ # - 1]], _?(GCD[#, n] == 1 &)] &@ FactorInteger[n][[All, 1]], {n, 103}] (* _Michael De Vlieger_, Sep 10 2018 *) %o A117371 (PARI) A117371(n) = if(1==n,0, my(f = factor(n), p = f[1, 1], gpf = f[#f~, 1], c = 0); while(p<gpf, if((n%p),c++); p = nextprime(1+p)); (c)); \\ _Antti Karttunen_, Sep 10 2018 %Y A117371 Cf. A117370, A137795. %K A117371 nonn %O A117371 1,14 %A A117371 _Leroy Quet_, Mar 10 2006 %E A117371 More terms from _R. J. Mathar_, Sep 05 2007