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.

Showing 1-3 of 3 results.

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).

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Leroy Quet, Mar 10 2006

Keywords

Comments

This sequence first differs from sequence A117370 at the 30th term.

Examples

			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.
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    A117371(n) = if(1==n,0, my(f = factor(n), p = f[1, 1], gpf = f[#f~, 1], c = 0); while(pAntti Karttunen, Sep 10 2018

Formula

a(n) = A001221(A137795(n)). - Antti Karttunen, Sep 10 2018

Extensions

More terms from R. J. Mathar, Sep 05 2007

A178921 Product of distances between successive distinct prime divisors of n; zero if n has only 1 distinct prime factor.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 5, 2, 0, 0, 1, 0, 3, 4, 9, 0, 1, 0, 11, 0, 5, 0, 2, 0, 0, 8, 15, 2, 1, 0, 17, 10, 3, 0, 4, 0, 9, 2, 21, 0, 1, 0, 3, 14, 11, 0, 1, 6, 5, 16, 27, 0, 2, 0, 29, 4, 0, 8, 8, 0, 15, 20, 6, 0, 1, 0, 35, 2, 17, 4, 10, 0, 3, 0, 39, 0, 4, 12, 41, 26, 9, 0, 2, 6, 21, 28, 45, 14, 1, 0, 5, 8, 3, 0, 14, 0, 11
Offset: 1

Views

Author

Alex Ratushnyak, Aug 18 2012

Keywords

Comments

For n <= 41, a(n) = A049087(n).

Crossrefs

Cf. also A137795.

Programs

  • Mathematica
    f[n_] := Module[{ps}, If[n <= 1, 0, ps = Transpose[FactorInteger[n]][[1]]; Times @@ Differences[ps]]]; Table[f[n], {n, 100}] (* T. D. Noe, Aug 20 2012 *)
    Array[Apply[Times, Differences@ FactorInteger[#][[All, 1]] /. {} -> 0] &, 105] (* Michael De Vlieger, Sep 10 2018 *)
  • PARI
    A178921(n) = if(1>=omega(n), 0, my(ps = factor(n)[,1], m = 1); for(i=2, #ps, m *= (ps[i]-ps[i-1])); (m)); \\ Antti Karttunen, Sep 07 2018
  • Python
    from sympy import primerange
    primes = list(primerange(2,500))
    for n in range(1,100):
        d = n
        prev = 0
        product = 1
        for p in primes:
            if d%p==0:
                if prev:
                    product *= p-prev
                while d%p==0:
                    d//=p
                if d==1:
                    break
                prev = p
        if prev==0:
            product = 0
        print(product, end=',')
    

Extensions

More terms from Antti Karttunen, Sep 07 2018

A143265 a(n) = the smallest integer >= n such that all the distinct primes that divide n and a(n) together are members of a set of consecutive primes. In other words, a(n) is the smallest integer >= n such that n*a(n) is contained in sequence A073491.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 11, 12, 13, 15, 15, 16, 17, 18, 19, 21, 25, 105, 23, 24, 25, 1155, 27, 30, 29, 30, 31, 32, 35, 15015, 35, 36, 37, 255255, 385, 42, 41, 45, 43, 105, 45, 4849845, 47, 48, 49, 51, 5005, 1155, 53, 54, 56, 60, 85085, 111546435, 59, 60, 61
Offset: 1

Views

Author

Leroy Quet, Aug 03 2008

Keywords

Examples

			20 is factored as 2^2 *5^1. Checking the integers >= 20: 20*20 is not factorable into consecutive primes, since 3 is missing. 21 is factored as 3^1 *7^1. Since the distinct primes that divide 20 and 21 (which are 2,3,5,7) form a set of consecutive primes, then a(20) = 21.
		

Crossrefs

Formula

a(n) = A137795(n) * Ceiling(n/A137795(n)). - Ray Chandler, Nov 09 2008

Extensions

Inserted a(15) and a(21) and extended by R. J. Mathar, Aug 14 2008
a(46)-a(61) from Ray Chandler, Nov 09 2008
Showing 1-3 of 3 results.