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-8 of 8 results.

A103668 Number of semiprimes between prime(n) and prime(n+1).

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 0, 2, 2, 0, 3, 2, 0, 1, 2, 3, 0, 2, 1, 0, 2, 1, 3, 4, 0, 0, 1, 0, 1, 6, 1, 2, 0, 5, 0, 1, 3, 1, 1, 2, 0, 3, 0, 1, 0, 6, 7, 1, 0, 0, 2, 0, 2, 2, 2, 2, 0, 1, 1, 0, 3, 7, 1, 0, 1, 6, 2, 3, 0, 0, 2, 3, 1, 1, 2, 1, 4, 1, 2, 4, 0, 2, 0, 1, 0, 3, 3, 1, 0, 1, 4, 3, 1, 2, 2, 1, 5, 0, 7, 3, 3, 2, 2, 0, 1
Offset: 1

Views

Author

Zak Seidov, Feb 12 2005

Keywords

Examples

			a(4)=2 because between prime(4)=7 and prime(5)=11 there are two semiprimes: 3*3 and 2*5.
a(11)=3 because between p(11)=31 and p(12)=37 there are three semiprimes: 33=3*11, 34=2*17 and 35=5*7.
		

Crossrefs

The first occurrence of k = 0, 1, 2, ... is at position 1, 2, 4, 11, 24, 34, 30, 47, ... (A103669).
Primes: A000040, semiprimes: A001358, number of primes between two successive semiprimes: A088700.

Programs

A103654 Primes which are the average of two successive semiprimes.

Original entry on oeis.org

5, 53, 67, 89, 113, 131, 173, 211, 251, 293, 307, 337, 379, 409, 449, 487, 491, 499, 631, 683, 701, 727, 751, 769, 787, 919, 941, 953, 991, 1009, 1039, 1051, 1063, 1117, 1193, 1259, 1399, 1459, 1471, 1499, 1511, 1567, 1627, 1697, 1709, 1733, 1759, 1787, 1801
Offset: 1

Views

Author

Zak Seidov, Feb 12 2005

Keywords

Examples

			a(3)=67 because 65 and 69 are two successive semiprimes closest to 67 and 67=(65+69)/2;a(333)=22679 because 22677 and 22691 are two successive semiprimes closest to 22679 and 22679=(22677+22681)/2.
		

Crossrefs

Indices of these primes: A103655. Primes: A000040, semiprimes: A001358, number of primes between successive semiprimes: A088700, number of semiprimes between two successive primes: A103668.

Programs

  • PARI
    list(lim)=my(v=List(),u=v,t,lim2=lim+log(lim)^2);forprime(p=2,sqrt(lim2),t=p;forprime(q=p,lim2\t,listput(v,t*q)));v=vecsort(Vec(v));for(i=2,#v,t=(v[i]+v[i-1])/2;if(denominator(t)==1&&isprime(t),if(t>lim,break,listput(u,t))));Vec(u) \\ Charles R Greathouse IV, Oct 08 2012

Formula

p=(q+r)/2, where q

p are two successive semiprimes closest to p.

A103655 Indices of primes which are the average of two successive semiprimes.

Original entry on oeis.org

3, 16, 19, 24, 30, 32, 40, 47, 54, 62, 63, 68, 75, 80, 87, 93, 94, 95, 115, 124, 126, 129, 133, 136, 138, 157, 160, 162, 167, 169, 175, 177, 179, 187, 196, 205, 222, 232, 233, 239, 240, 247, 258, 265, 267, 270, 274, 277, 279, 298, 299, 318, 327, 335, 336, 339
Offset: 1

Views

Author

Zak Seidov, Feb 12 2005

Keywords

Examples

			19 is a member because p(19)=67; 65 and 69 are two successive semiprimes closest to 67 and 67=(65+69)/2.
		

Crossrefs

Corresponding primes: A103654. Primes: A000040, semiprimes: A001358, number of primes between two successive semiprimes: A088700, number of semiprimes between two successive primes: A103668.

Programs

  • Mathematica
    PrimePi[#]&/@Select[Mean/@Partition[Select[Range[2500],PrimeOmega[#]==2&],2,1],PrimeQ] (* Harvey P. Dale, Sep 08 2024 *)

Formula

a(n)=pi(A103654(n)).

A103669 First occurrence of just n semiprimes occurs between the a(n)-th prime and the next prime.

Original entry on oeis.org

1, 2, 4, 11, 24, 34, 30, 47, 221, 259, 189, 375, 429, 217, 1831, 1879, 1229, 3795, 3644, 4522, 2225, 10229, 14862, 4612, 34202, 38590, 66762, 14357, 44227, 40933, 33608, 161441, 31545, 111924, 415069, 278832, 126172, 1576499, 104071, 271743, 786922, 3183065, 4875380, 3166684, 2219883, 6080675, 6443469, 1319945
Offset: 1

Views

Author

Zak Seidov, Feb 12 2005

Keywords

Comments

k(31)>78496, k(32)=31545.
The first occurrence of k in A103668. - Robert G. Wilson v, May 07 2005

Examples

			n=3, k=11, p(11)=31, p(12)=37, three semiprimes between 31 and 37 are 33=3*11, 34=2*17,35=5*7.
		

Crossrefs

Primes: A000040, semiprimes: A001358, number of primes between two successive semiprimes: A088700, number of semiprimes between two successive primes: A103668.

Programs

  • Mathematica
    fQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; f[n_] := Count[fQ /@ Range[Prime[n] + 1, Prime[n + 1] - 1], True];
    t = Table[ f[n], {n, 1600000}]; Position[t, #, 1, 1] & /@ Range[0, 41] // Flatten (* Or *) t = Table[0, {50}]; Do[ a = f[n]; If[ t[[a + 1]] == 0, t[[a + 1]] = n], {n, 1600000}]

Extensions

More terms from Robert G. Wilson v, May 07 2005

A088701 Smallest semiprime such that n primes will follow until the next semiprime.

Original entry on oeis.org

9, 4, 10, 95, 818, 2681, 16053, 35981, 797542, 1069541, 340894, 6974465, 3586843, 2070050198, 5238280946, 14499777101, 2601693504238, 7472089131123
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 08 2003

Keywords

Comments

Is this sequence infinite? - David A. Corneth, Aug 17 2018

Crossrefs

Cf. A214520 (primes that are the only prime between consecutive semiprimes).

Programs

  • Mathematica
    om = Array[PrimeOmega, 1100000]; sp = Flatten@ Position[om, 2]; Table[ sp[[ SelectFirst[ Range[Length[sp] - 1], Count[Take[om, {sp[[#]], sp[[# + 1]]}], x_ /; x == 1] == j &, 0]]], {j, 0, 10}] (* Giovanni Resta, Aug 16 2018 *)
  • Perl
    use ntheory ":all";
    my($l,$nextn,@C)=(4,0);
    forcomposites {
      if (is_semiprime($_)) {
        my $c = prime_count($l+1,$_-1);
        if (!defined $C[$c]) {
          $C[$c] = $l;
          while (defined $C[$nextn]) { print "$nextn $C[$nextn]\n"; $nextn++; }
        }
        $l = $_;
      }
    } 5,1e7;  # Dana Jacobsen, Aug 16 2018

Formula

A088700(a(n)) = n and A088700(k) <> n for 1 <= k < a(n).

Extensions

a(11)-a(15) from Donovan Johnson, Mar 14 2010
a(16) from Giovanni Resta, Aug 17 2018
a(17) from Giovanni Resta, Aug 18 2018

A108197 Number of composite numbers between two successive semiprimes.

Original entry on oeis.org

0, 1, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 1, 0, 4, 1, 1, 2, 1, 0, 1, 2, 2, 2, 2, 3, 1, 0, 0, 2, 1, 0, 0, 7, 2, 2, 2, 0, 1, 0, 0, 4, 2, 0, 4, 0, 0, 1, 0, 6, 1, 0, 1, 3, 1, 6, 0, 2, 1, 1, 4, 4, 0, 0, 1, 0, 2, 2, 0, 0, 1, 0, 0, 1, 3, 5, 1, 7, 1, 2, 0, 3, 2, 1, 1, 4, 2, 6, 1, 1, 2, 2, 0, 1, 0, 0, 1, 2, 2, 3, 1, 1, 2, 0, 1
Offset: 1

Views

Author

Giovanni Teofilatto, Jun 15 2005

Keywords

Comments

This is to A046933 as semiprimes A001358 are to primes A000040. This is to composites A002808 as A088700 is to primes. a(A070552(i)) = 0. - Jonathan Vos Post, Oct 10 2007
a(n) = 0 if A001358(n) is in A070552. - Jonathan Vos Post, Mar 11 2007

Examples

			a(1) = 0 because between 2*2 and 2*3 there is 5 and it is not composite.
a(2) = 1 because between 2*3 and 3*3 there is 8 = 2*2*2;
a(6) = 3 because between 3*5 and 3*7 there are three composite numbers: {16, 18, 20}.
a(10) = 4 because between 2*13 and 3*11 there are four composite numbers: {27, 28, 30, 32}.
a(15) = 4 because there are four composites {40,42,44,45} between semiprime(15)=39 and semiprime(16)=46.
		

Crossrefs

Semiprime analog of A046933.

Programs

  • Maple
    with(numtheory): sp:=proc(n) if bigomega(n)=2 then n else fi end: SP:=[seq(sp(n),n=1..450)]: for j from 1 to nops(SP)-1 do ct:=0: for i from SP[j]+1 to SP[j+1]-1 do if isprime(i)=false then ct:=ct+1 else ct:=ct fi: od: a[j]:=ct: od:seq(a[j],j=1..nops(SP)-1); # Emeric Deutsch, Mar 30 2007
    A001358 := proc(nmin) local a,n ; a :=[] ; n := 1 ; while nops(a) < nmin do if numtheory[bigomega](n) = 2 then a := [op(a),n] ; fi ; n := n+1 ; od: RETURN(a) ; end: A000720 := proc(n) numtheory[pi](n) ; end: A065855 := proc(n) n-A000720(n)-1 ; end: A108197 := proc(nmin) local a,n,a001358 ; a001358 := A001358(nmin+1) ; a := [] ; for n from 1 to nops(a001358)-1 do a := [op(a), A065855(op(n+1,a001358))-A065855(op(n,a001358))-1 ] ; od; RETURN(a) ; end: A108197(100) ; # R. J. Mathar, Oct 23 2007
  • Mathematica
    terms = 105;
    cc = Select[Range[4 terms], CompositeQ] /. c_ /; PrimeOmega[c] == 2 -> 0;
    SequenceReplace[cc, {0, c___ /; FreeQ[{c}, 0]} :> Length[{c}]][[;; terms]] (* Jean-François Alcover, Mar 31 2020 *)

Formula

a(n) = A065855(A001358(n+1)) - A065855(A001358(n)) - 1. - R. J. Mathar, Oct 23 2007
a(n)=A065516(n)-1-A088700(n). - R. J. Mathar, Jul 31 2008

Extensions

Corrected and extended by Ray Chandler, Jul 07 2005
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jul 13 2007
Further edited by N. J. A. Sloane at the suggestion of R. J. Mathar, Jul 01 2008

A176451 Number of primes between two consecutive nonprimes in A037143.

Original entry on oeis.org

2, 1, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 0, 1, 0, 2, 1, 0, 1, 0, 0, 2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 18 2010

Keywords

Comments

2 together with the number of primes between successive semiprimes.

Examples

			a(1) = 2 because A037143(1) = 1 (nonprime) < A037143(2) = 2 (prime) < A037143(3) = 3 (prime) < A037143(4) = 4 (nonprime).
		

Crossrefs

Programs

  • Mathematica
    Join[{2}, -1 + Differences[Position[Select[PrimeOmega[Range[400]], # < 3 &], 2] // Flatten]] (* Amiram Eldar, Sep 07 2024 *)

Formula

a(n) = A088700(n-1) for n >= 2.

A130973 Number of primes between successive pairs of twin primes, for a(n) > 0.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 4, 2, 1, 3, 1, 2, 3, 10, 4, 7, 4, 3, 2, 1, 2, 18, 2, 2, 17, 1, 2, 6, 9, 3, 1, 1, 1, 8, 3, 2, 15, 1, 4, 1, 1, 7, 7, 4, 4, 3, 4, 1, 1, 7, 2, 5, 1, 5, 18, 2, 5, 4, 3, 1, 5, 1, 18, 12, 2, 8, 1, 4, 2, 5, 4, 1, 1, 1, 9, 10
Offset: 1

Views

Author

Omar E. Pol, Aug 23 2007

Keywords

Comments

a(k) corresponds to the k-th term in the isolated prime sequence A007510 or A134797. a(1) corresponds to 23. a(2) corresponds to 37. a(3) corresponds to 47 and 53. - Enrique Navarrete, Jan 28 2017
Lengths of the runs of consecutive integers in A176656. - R. J. Mathar, Feb 19 2017

Crossrefs

Cf. A001223, A007510 (isolated primes), A027883, A048614, A048198, A052011, A052012, A061273, A076777, A073784, A082602, A088700, A179067 (clusters of twin primes).
Showing 1-8 of 8 results.