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-4 of 4 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

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

A212820 Balanced primes which are the average of two successive semiprimes.

Original entry on oeis.org

5, 53, 173, 211, 1511, 3307, 3637, 4457, 4993, 6863, 11411, 11731, 11903, 12653, 15907, 18223, 20107, 20201, 20347, 20731, 22051, 23801, 26041, 35911, 39113, 40493, 46889, 47303, 51551, 52529, 60083, 63559, 69623, 71011, 75787, 77081, 78803, 85049, 91297
Offset: 1

Views

Author

Gerasimov Sergey, May 28 2012

Keywords

Comments

Prime p which is the average of the previous prime and the following prime and is also the average of two successive semiprimes.

Examples

			53 is in the sequence because it is the average of 47 and 59 (the two neighboring primes) and 51 and 55 (the two neighboring semiprimes).
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    prevsp:= proc(n) local k; for k from n-1 by -1
               while isprime(k) or bigomega(k)<>2 do od; k end:
    nextsp:= proc(n) local k; for k from n+1
               while isprime(k) or bigomega(k)<>2 do od; k end:
    a:= proc(n) option remember; local p;
          p:= `if`(n=1, 2, a(n-1));
          do p:= nextprime(p);
             if p=(prevprime(p)+nextprime(p))/2 and
                p=(prevsp(p)+nextsp(p))/2 then break fi
          od; p
        end:
    seq (a(n), n=1..40);  # Alois P. Heinz, Jun 03 2012
  • Mathematica
    prevsp[n_] := Module[{k}, For[k = n-1, PrimeQ[k] || PrimeOmega[k] != 2, k--]; k];
    nextsp[n_] := Module[{k}, For[k = n+1, PrimeQ[k] || PrimeOmega[k] != 2 , k++]; k];
    a[n_] := a[n] = Module[{p}, p = If[n==1, 2, a[n-1]]; While[True, p = NextPrime[p]; If[p == (NextPrime[p, -1] + NextPrime[p])/2 && p == (prevsp[p] + nextsp[p])/2, Break[]]]; p];
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Mar 24 2017, after Alois P. Heinz *)

Formula

{ A212820 } = { A006562 } intersection { A103654 }.
Showing 1-4 of 4 results.