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

A063637 Primes p such that p+2 is a semiprime.

Original entry on oeis.org

2, 7, 13, 19, 23, 31, 37, 47, 53, 67, 83, 89, 109, 113, 127, 131, 139, 157, 167, 181, 199, 211, 233, 251, 257, 263, 293, 307, 317, 337, 353, 359, 379, 389, 401, 409, 443, 449, 467, 479, 487, 491, 499, 503, 509, 541, 557, 563, 571, 577, 587, 631, 647, 653, 677
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2001

Keywords

Comments

Primes of the form p*q - 2, where p and q are primes.
Union of A049002 and A115093. - T. D. Noe, Mar 01 2006

Examples

			From _K. D. Bajpai_, Sep 06 2014: (Start)
a(3) = 13, which is prime, and 13 + 2 = 15 = 3 * 5, which is a semiprime.
a(4) = 19, which is prime, and 19 + 2 = 21 = 3 * 7, which is a semiprime.
(End)
		

References

  • J.-R. Chen, On the representation of a large even integer as the sum of a prime and a product of at most two primes, Sci. Sinica 16 (1973), 157-176.

Crossrefs

Cf. A109611 (Chen primes).

Programs

  • Haskell
    a063637 n = a063637_list !!(n-1)
    a063637_list = filter ((== 1) . a064911 . (+ 2)) a000040_list
    -- Reinhard Zumkeller, Nov 15 2011
  • Maple
    select(t -> isprime(t) and numtheory:-bigomega(t+2)=2, [2, seq(2*i+1,i=1..500)]); # Robert Israel, Sep 07 2014
  • Mathematica
    f[n_] := Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ FactorInteger[ n]]; Select[ Prime[ Range[ 123]], f[ # + 2] == 2 &] (* Robert G. Wilson v, Apr 30 2005 *)
    Select[Prime[Range[500]],PrimeOmega[#+2]==2&]  (* K. D. Bajpai, Sep 06 2014 *)
  • PARI
    { n=0; for (m=1, 10^9, p=prime(m); if (bigomega(p + 2) == 2, write("b063637.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 26 2009
    

Formula

a(n) = A062721(n) - 2.
A010051(a(n)) * A064911(a(n) + 2) = 1. - Reinhard Zumkeller, Nov 15 2011

A157931 Numbers that are both the sum and the product of two primes.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 25, 26, 33, 34, 38, 39, 46, 49, 55, 58, 62, 69, 74, 82, 85, 86, 91, 94, 106, 111, 115, 118, 122, 129, 133, 134, 141, 142, 146, 158, 159, 166, 169, 178, 183, 194, 201, 202, 206, 213, 214, 218, 226, 235, 253, 254, 259, 262, 265, 274, 278
Offset: 1

Views

Author

William Weeks (dach(AT)kuci.org), Mar 09 2009

Keywords

Comments

Assuming the Goldbach conjecture, this is A001358 intersect (A005843 union A052147), since an odd number n is the sum of two primes iff n-2 is prime. - N. J. A. Sloane, Mar 14 2009
The first few terms of A001358: Semiprimes, not members of A157931 are: 35, 51, 57, 65, 77, 87, 93, 95, ..., . - Robert G. Wilson v, Mar 15 2009

Examples

			For the numbers up to 100, the solutions are 4 = (2+2) = (2*2); 6 = (3+3) = (2*3); 9 = (2+7) = (3*3); 10 = (3+7) = (2*5); 14 = (3+11) = (2*7); 15 = (2+13) = (3*5); 21 = (2+19) = (3*7); 22 = (3+19) = (2*11); 25 = (2+23) = (5*5); 26 = (3+23) = (2*13); 33 = (2+31) = (3*11); 34 = (3+31) = (2*17); 38 = (7+31) = (2*19); 39 = (2+37) = (3*13); 46 = (3+43) = (2*23); 49 = (2+47) = (7*7); 55 = (2+53) = (5*11); 58 = (5+53) = (2*29); 62 = (3+59) = (2*31); 69 = (2+67) = (3*23); 74 = (3+71) = (2*37); 82 = (3+79) = (2*41); 85 = (2+83) = (5*17); 86 = (3+83) = (2*43); 91 = (2+89) = (7*13); 94 = (5+89) = (2*47).
		

Crossrefs

Cf. A043326 Numbers n such that n is a product of two different primes and n - 2 is prime, A062721 Numbers n such that n is a product of two primes and n - 2 is prime. - Zak Seidov, Mar 15 2009

Programs

  • Haskell
    a157931 n = a157931_list !! (n-1)
    a157931_list = filter ((== 1) . a064911) a014091_list
    -- Reinhard Zumkeller, Oct 15 2014
  • Maple
    isA014091 := proc(n) for i from 1 do p := ithprime(i) ; if p > n/2 then RETURN(false); fi; if isprime(n-p) then RETURN(true) ; fi; od: end: isA001358 := proc(n) RETURN(numtheory[bigomega](n) = 2) ; end: for n from 4 to 500 do if isA001358(n) and isA014091(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Mar 15 2009
  • Mathematica
    fQ[n_] := Block[{k = 2}, While[k < n, If[ PrimeQ[n - k], Break[]]; k = NextPrime@k]; k + 1 < n]; semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@n == 2; Select[ Range@ 295, fQ@# && semiPrimeQ@# &] (* Robert G. Wilson v, Mar 15 2009 *)
    Select[Union[Flatten[Table[Prime[i] + Prime[j], {i, 50}, {j, 50}]]], PrimeOmega[#] == 2 &] (* Alonso del Arte, Feb 08 2013 *)
    Union[Select[Total/@Tuples[Prime[Range[60]],2],PrimeOmega[#]==2&]] (* Harvey P. Dale, Jul 27 2015 *)

Formula

A014091 INTERSECT A001358. - R. J. Mathar, Mar 15 2009

Extensions

Edited by N. J. A. Sloane, Mar 14 2009
Extended by R. J. Mathar and Robert G. Wilson v, Mar 15 2009

A158318 Primes p such that 5p-2 is prime.

Original entry on oeis.org

3, 5, 11, 17, 23, 47, 53, 59, 71, 89, 101, 113, 131, 137, 149, 173, 191, 197, 233, 239, 257, 311, 317, 347, 383, 401, 431, 443, 449, 467, 479, 509, 569, 593, 617, 641, 683, 719, 761, 773, 827, 857, 929, 941, 947, 1031, 1061, 1097, 1163, 1181, 1223, 1229
Offset: 1

Views

Author

Zak Seidov, Mar 16 2009

Keywords

Comments

Hence 5p are terms in A157931, A062721 and (except of 25) in A043326.

Crossrefs

Cf. A043326 Numbers n such that n is a product of two different primes and n-2 is prime, A062721 Numbers n such that n is a product of two primes and n-2 is prime, A157931 Numbers that are both the sum and the product of two primes.

Programs

  • Mathematica
    Select[Prime[Range[300]],PrimeQ[5#-2]&] (* Harvey P. Dale, Apr 10 2015 *)
  • PARI
    isok(p) = isprime(p) && isprime(5*p-2);  \\ Michel Marcus, Oct 16 2013

A107986 Composite numbers of the form p+2 where p is prime.

Original entry on oeis.org

4, 9, 15, 21, 25, 33, 39, 45, 49, 55, 63, 69, 75, 81, 85, 91, 99, 105, 111, 115, 129, 133, 141, 153, 159, 165, 169, 175, 183, 195, 201, 213, 225, 231, 235, 243, 253, 259, 265, 273, 279, 285, 295, 309, 315, 319, 333, 339, 351, 355, 361, 369, 375, 381, 385, 391
Offset: 1

Views

Author

Cino Hilliard, Jun 13 2005

Keywords

Comments

This sequence is analogous to the sequence formed by the Goldbach-Euler conjecture that every even number greater than 2 is the sum of 2 primes. If p + 2 is prime then p and p + 2 are twin primes. The number of terms in this sequence is infinite. This follows immediately from the proof that the number of primes p is infinite. Conjecture: The ratio of the number of terms in this sequence to Pi(n) tends to a limit < 1.
The first term in this sequence that is not also in A062721 is 45 = 3^2 * 5. - Alonso del Arte, May 03 2014

Crossrefs

Programs

  • Mathematica
    Select[Range[4, 399], Not[PrimeQ[#]] && PrimeQ[# - 2] &] (* Alonso del Arte, May 03 2014 *)

Formula

a(n) = A067774(n) + 2. - Amiram Eldar, Jul 05 2024

A043326 Numbers k such that k is a product of two different primes and k-2 is prime.

Original entry on oeis.org

15, 21, 33, 39, 55, 69, 85, 91, 111, 115, 129, 133, 141, 159, 183, 201, 213, 235, 253, 259, 265, 295, 309, 319, 339, 355, 381, 391, 403, 411, 445, 451, 469, 481, 489, 493, 501, 505, 511, 543, 559, 565, 573, 579, 589, 633, 649, 655, 679, 685
Offset: 1

Views

Author

Olivier Gérard, Jul 19 2001

Keywords

Crossrefs

Subsequence of A006881.

Programs

  • Mathematica
    Select[Range[700],PrimeOmega[#]==PrimeNu[#]==2&&PrimeQ[#-2]&] (* Harvey P. Dale, Feb 01 2014 *)
    Select[Prime[Range[200]]+2,PrimeOmega[#]==PrimeNu[#]==2&] (* Harvey P. Dale, Oct 13 2018 *)
  • PARI
    is(n)=isprime(n-2) && bigomega(n)==2 && !issquare(n) \\ Charles R Greathouse IV, Jul 20 2014

A089268 Odd semiprimes m such that m-2 is composite.

Original entry on oeis.org

35, 51, 57, 65, 77, 87, 93, 95, 119, 121, 123, 143, 145, 155, 161, 177, 185, 187, 203, 205, 209, 215, 217, 219, 221, 237, 247, 249, 267, 287, 289, 291, 299, 301, 303, 305, 321, 323, 327, 329, 335, 341, 365, 371, 377, 393, 395, 407, 413, 415, 417, 427, 437
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 28 2003

Keywords

Comments

A087942(a(n)) = 0.
Assuming Goldbach's conjecture that every even number greater than 2 is the sum of two primes, these are the numbers that are the product of two primes but not the sum of two primes. - Michael B. Porter, Feb 08 2013

Crossrefs

Programs

  • Mathematica
    Take[Select[Union[Flatten[Table[Prime[i] Prime[j], {i, 2, 25}, {j, 2, 25}]]], Not[PrimeQ[# - 2]] &], 50] (* Alonso del Arte, Feb 08 2013 *)
  • PARI
    isok(m) = (m%2) && (bigomega(m)==2) && !isprime(m-2); \\ Michel Marcus, Oct 19 2021

A241809 Semiprimes sp such that sp+2 is a prime.

Original entry on oeis.org

9, 15, 21, 35, 39, 51, 57, 65, 69, 77, 87, 95, 111, 129, 155, 161, 177, 209, 221, 237, 249, 267, 291, 305, 309, 329, 335, 365, 371, 377, 381, 395, 407, 417, 437, 447, 485, 489, 497, 501, 519, 545, 591, 597, 611, 629, 671, 681, 689, 699, 707, 717, 731, 737, 749
Offset: 1

Views

Author

K. D. Bajpai, Apr 29 2014

Keywords

Examples

			a(2) = 15 = 3*5, which is semiprime and 15+2 = 17 is a prime.
a(6) = 51 = 3*17, which is semiprime and 51+2 = 53 is a prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A241809:= proc(); if bigomega(x)=2 and isprime(x+2)then  RETURN (x); fi; end: seq(A241809 (), x=1..2000);
  • Mathematica
    A241809={};Do[If[PrimeOmega[n]==2&&PrimeQ[n+2],AppendTo[A241809,n]],{n,1000}];A241809
    Select[Prime[Range[200]]-2,PrimeOmega[#]==2&] (* Harvey P. Dale, Aug 06 2015 *)
    SequencePosition[Table[Which[PrimeQ[n],1,PrimeOmega[n]==2,2,True,0],{n,800}],{2,,1}][[;;,1]] (* _Harvey P. Dale, Oct 05 2023 *)
  • PARI
    for(k=1, 1000, if(bigomega(k)==2 && isprime(k+2), print1(k, ", "))) \\ Colin Barker, May 07 2014

Formula

a(n) = A063638(n) - 2.

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

A121884 Excess of n-th semiprime over previous prime.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Aug 31 2006

Keywords

Comments

a(n) = 1 iff n is in A077068. a(n) = 2 iff n is in A062721.

Crossrefs

Programs

  • Mathematica
    semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; lst1 = Select[ Range@ 325, semiPrimeQ@# &]; lst = Select[ Range@ 500, semiPrimeQ@# &]; lst - (NextPrime[ #, -1] & /@ lst) (* Robert G. Wilson v, Mar 16 2009 *)
    #-NextPrime[#,-1]&/@Select[Range[400],PrimeOmega[#]==2&] (* Harvey P. Dale, Feb 15 2018 *)

Formula

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

Extensions

a(31)-a(103) from Robert G. Wilson v, Mar 16 2009
Showing 1-9 of 9 results.