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.

A102415 Greatest semiprime less than n-th prime.

Original entry on oeis.org

4, 6, 10, 10, 15, 15, 22, 26, 26, 35, 39, 39, 46, 51, 58, 58, 65, 69, 69, 77, 82, 87, 95, 95, 95, 106, 106, 111, 123, 129, 134, 134, 146, 146, 155, 161, 166, 169, 178, 178, 187, 187, 194, 194, 209, 221, 226, 226, 226, 237, 237, 249, 254, 262, 267, 267, 274, 278, 278
Offset: 3

Views

Author

Reinhard Zumkeller, Jan 08 2005

Keywords

Examples

			a(3) = 4 since 4 is the greatest semiprime less than prime(3) = 5.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{m = Prime[n] - 1}, While[PrimeOmega[m] != 2, m--]; m]; Array[a, 60, 3] (* Amiram Eldar, Feb 06 2020 *)
  • PARI
    a(n) = {sp = prime(n)-1; while(bigomega(sp) != 2, sp--); sp;} \\ Michel Marcus, Mar 04 2017

Formula

a(n) < A000040(n) < A102414(n).

A283267 Smallest b-a such that a < prime(n) < b, where a,b are semiprimes.

Original entry on oeis.org

2, 3, 4, 4, 6, 6, 3, 7, 7, 3, 7, 7, 3, 4, 4, 4, 4, 5, 5, 5, 3, 4, 11, 11, 11, 5, 5, 4, 6, 4, 7, 7, 9, 9, 3, 5, 3, 8, 5, 5, 7, 7, 7, 7, 4, 5, 9, 9, 9, 10, 10, 4, 5, 3, 7, 7, 4, 9, 9, 4, 4, 5, 5, 5, 5, 4, 9, 9, 9, 3, 6, 6, 4, 4, 5, 3, 5, 4, 5, 5, 10, 10, 8, 8, 4
Offset: 3

Views

Author

Vladimir Shevelev, Mar 04 2017

Keywords

Comments

This is the first sequence from the series of sequences: "Smallest b-a such that a < prime(n)^k < b, where a,b are semiprimes", k = 1, 2, 3, ... .
This series of sequences was inspired by Zak Seidov's message to Seqfans (Mar 02 2017) where he suggested listing the triples of primes squared with neighbor semiprimes.
There are no semiprimes below prime(2) = 3 but there are below prime(3) = 5 so the offset is 3. - David A. Corneth, Mar 04 2017
From Michael De Vlieger, Mar 04 2017: (Start)
Largest term in range a(3)..a(10^m): {7, 11, 24, 38, 54, 74, ...}.
Largest term in range a(3)..a(2^m), m>1: {3, 6, 7, 11, 11, 14, 19, 20, 24, 25, 38, 38, 38, 47, 47, 55, 70, 74, ...}.
Largest run in range a(3)..a(10^m): {2, 4, 6, 8, 10, 12, ...}.
Largest run in range a(3)..a(2^m), m>1: {1, 2, 2, 4, 4, 4, 4, 5, 6, 7, 7, 8, 8, 10, 10, 10, 12, 12, ...}. (End)

Examples

			For a(3), the largest semiprime below 5 is 4. The least semiprime above 5 is 6. Therefore, (a, b) = (4, 6) giving a(3) = 6 - 4 = 2. - _David A. Corneth_, Mar 04 2017
		

Crossrefs

Programs

  • Mathematica
    Table[Module[{p = Prime@ n, a, b}, a = p - 1; b = p + 1; While[PrimeOmega@ a != 2, a--]; While[PrimeOmega@ b != 2, b++]; b - a], {n, 3, 120}] (* Michael De Vlieger, Mar 04 2017 *)
  • PARI
    issemi(n)=bigomega(n)==2
    a(n,p=prime(n))=my(a=p,b=p); while(!issemi(a--), ); while(!issemi(b++), ); b-a \\ Charles R Greathouse IV, Mar 04 2017

Formula

a(n) = A102414(n) - A102415(n). - Michel Marcus, Mar 04 2017

Extensions

More terms from Peter J. C. Moses, Mar 04 2017

A121885 Excess of n-th prime over previous semiprime.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Aug 31 2006

Keywords

Comments

See: A102415 Greatest semiprime less than n-th prime. See: A102414 Smallest semiprime greater than n-th prime.

Crossrefs

Programs

  • Mathematica
    SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] - 1; While[! SemiPrimeQ[i], i--]; Prime[n] - i, {n, 3, 100}] (* T. D. Noe, Oct 08 2012 *)
    eps[n_]:=Module[{c=n-1},While[PrimeOmega[c]!=2,c--];n-c]; Table[eps[n],{n,Prime[Range[3,90]]}] (* Harvey P. Dale, Aug 12 2014 *)
  • PARI
    dsemi(n)= { local(k=0); if(isprime(n),k=0;while(bigomega(n-k)<>2&&kAntonio Roldán, Oct 08 2012

Formula

a(n) = Min{A000040(n)-s for s < A000040(n) and s in A001358(k)}. a(n) = A000040(n) - A102415(n).

Extensions

Extended by T. D. Noe, Oct 08 2012

A217612 Difference between n-th prime and the smallest semiprime greater than it.

Original entry on oeis.org

2, 1, 1, 2, 3, 1, 4, 2, 2, 4, 2, 1, 5, 3, 2, 2, 3, 1, 2, 3, 1, 3, 2, 2, 9, 5, 3, 4, 2, 2, 2, 2, 4, 2, 6, 4, 1, 3, 2, 4, 4, 2, 3, 1, 4, 2, 2, 3, 8, 6, 2, 8, 6, 2, 2, 2, 5, 3, 1, 6, 4, 2, 2, 3, 1, 2, 3, 2, 8, 6, 2, 2, 4, 4, 2, 3, 2, 1, 2, 2, 3, 1, 6, 4, 6, 2, 2
Offset: 1

Views

Author

Antonio Roldán, Oct 08 2012

Keywords

Comments

Similar to A121885, but with smallest semiprime greater than it.

Examples

			a(7) = 4, because 17 is the seventh prime and 17+1 = 18 = 2*3^2, 17+2 = 19 = 19 and 17+3 = 20 = 2^2*5 are not semiprimes, but 17+4 = 21 = 3*7 is a semiprime.
		

Programs

  • Mathematica
    SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] + 1; While[! SemiPrimeQ[i], i++]; i - Prime[n], {n, 87}] (* T. D. Noe, Oct 08 2012 *)
    ssp[p_]:=Module[{k=1},While[PrimeOmega[p+k]!=2,k++];k]; Table[ssp[p],{p,Prime[ Range[100]]}] (* Harvey P. Dale, Sep 15 2022 *)
  • PARI
    m=0;forprime(n=2,10000,k=0;while(bigomega(n+k)<>2, k=k+1);m=m+1;write("B217612.txt",m,"  ",k)) \\ Antonio Roldán, Oct 08 2012

Formula

a(n) = A102414(n) - A000040(n).
Showing 1-4 of 4 results.