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-10 of 19 results. Next

A109611 Chen primes: primes p such that p + 2 is either a prime or a semiprime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 47, 53, 59, 67, 71, 83, 89, 101, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 179, 181, 191, 197, 199, 211, 227, 233, 239, 251, 257, 263, 269, 281, 293, 307, 311, 317, 337, 347, 353, 359, 379, 389, 401, 409
Offset: 1

Views

Author

Paul Muljadi, Jul 31 2005

Keywords

Comments

43 is the first prime which is not a member (see A102540).
Contains A001359 = lesser of twin primes.
A063637 is a subsequence. - Reinhard Zumkeller, Mar 22 2010
In 1966 Chen proved that this sequence is infinite; his proof did not appear until 1973 due to the Cultural Revolution. - Charles R Greathouse IV, Jul 12 2016
Primes p such that p + 2 is a term of A037143. - Flávio V. Fernandes, May 08 2021
Named after the Chinese mathematician Chen Jingrun (1933-1996). - Amiram Eldar, Jun 10 2021

Examples

			a(4) = 7 because 7 + 2 = 9 and 9 is a semiprime.
a(5) = 11 because 11 + 2 = 13, a prime.
		

Crossrefs

Programs

  • Maple
    A109611 := proc(n)
        option remember;
        if n =1 then
            2;
        else
            a := nextprime(procname(n-1)) ;
            while true do
                if isprime(a+2) or numtheory[bigomega](a+2) = 2 then
                    return a;
                end if;
                a := nextprime(a) ;
            end do:
        end if;
    end proc: # R. J. Mathar, Apr 26 2013
  • Mathematica
    semiPrimeQ[x_] := TrueQ[Plus @@ Last /@ FactorInteger[ x ] == 2]; Select[Prime[Range[100]], PrimeQ[ # + 2] || semiPrimeQ[ # + 2] &] (* Alonso del Arte, Aug 08 2005 *)
    SequencePosition[PrimeOmega[Range[500]], {1, , 1|2}][[All, 1]] (* _Jean-François Alcover, Feb 10 2018 *)
  • PARI
    isA001358(n)= if( bigomega(n)==2, return(1), return(0) );
    isA109611(n)={ if( ! isprime(n), return(0), if( isprime(n+2), return(1), return( isA001358(n+2)) ); ); }
    { n=1; for(i=1,90000, p=prime(i); if( isA109611(p), print(n," ",p); n++; ); ); } \\ R. J. Mathar, Aug 20 2006
    
  • PARI
    list(lim)=my(v=List([2]),semi=List(),L=lim+2,p=3); forprime(q=3,L\3, forprime(r=3,min(L\q,q), listput(semi,q*r))); semi=Set(semi); forprime(q=7,lim, if(setsearch(semi,q+2), listput(v,q))); forprime(q=5,L, if(q-p==2, listput(v,p)); p=q); Set(v) \\ Charles R Greathouse IV, Aug 25 2017
    
  • Python
    from sympy import isprime, primeomega
    def ok(n): return isprime(n) and (primeomega(n+2) < 3)
    print(list(filter(ok, range(1, 410)))) # Michael S. Branicky, May 08 2021

Formula

a(n)+2 = A139690(n).
Sum_{n>=1} 1/a(n) converges (Zhou, 2009). - Amiram Eldar, Jun 10 2021

Extensions

Corrected by Alonso del Arte, Aug 08 2005

A063638 Primes p such that p-2 is a semiprime.

Original entry on oeis.org

11, 17, 23, 37, 41, 53, 59, 67, 71, 79, 89, 97, 113, 131, 157, 163, 179, 211, 223, 239, 251, 269, 293, 307, 311, 331, 337, 367, 373, 379, 383, 397, 409, 419, 439, 449, 487, 491, 499, 503, 521, 547, 593, 599, 613, 631, 673, 683, 691, 701, 709, 719, 733, 739
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2001

Keywords

Comments

Primes of form p*q + 2, where p and q are primes.
11 is the only prime of this form where p=q. For prime p>3, 3 divides p^2+2. - T. D. Noe, Mar 01 2006
The asymptotic growth of this sequence is relevant for A204142. We have a(10^k) = (11, 79, 1571, 27961, 407741, 5647823, ...). - M. F. Hasler, Feb 13 2012

Crossrefs

Programs

  • Haskell
    a063638 n = a063638_list !! (n-1)
    a063638_list = map (+ 2) $ filter ((== 1) . a064911) a040976_list
    -- Reinhard Zumkeller, Feb 22 2012
  • Mathematica
    Take[Select[ # + 2 & /@ Union[Flatten[Outer[Times, Prime[Range[100]], Prime[Range[100]]]]], PrimeQ], 60]
    Select[Prime[Range[200]],PrimeOmega[#-2]==2&] (* Paolo Xausa, Oct 30 2023 *)
  • PARI
    n=0; for (m=2, 10^9, p=prime(m); if (bigomega(p - 2) == 2, write("b063638.txt", n++, " ", p); if (n==1000, break))) \\ Harry J. Smith, Aug 26 2009
    
  • PARI
    forprime(p=3,9999, bigomega(p-2)==2 & print1(p","))
    
  • PARI
    p=2; for(n=1,1e4, until(bigomega(-2+p=nextprime(p+1))==2,); write("b063638.txt", n" "p)) \\ M. F. Hasler, Feb 13 2012
    
  • PARI
    list(lim)=my(v=List(), t); forprime(p=3, (lim-2)\3, forprime(q=3, min((lim-2)\p, p), t=p*q+2; if(isprime(t), listput(v, t)))); Set(v) \\ Charles R Greathouse IV, Aug 05 2016
    

Formula

a(n) = A241809(n) + 2. - Hugo Pfoertner, Oct 30 2023

A063643 Primes with 2 representations: p*q - 2 = u*v + 2 where p, q, u and v are primes.

Original entry on oeis.org

23, 37, 53, 67, 89, 113, 131, 157, 211, 251, 293, 307, 337, 379, 409, 449, 487, 491, 499, 503, 631, 683, 701, 719, 751, 769, 787, 919, 941, 953, 991, 1009, 1039, 1117, 1193, 1201, 1259, 1381, 1399, 1439, 1459, 1471, 1499, 1511, 1567, 1709, 1733, 1759, 1801
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2001

Keywords

Comments

Or, primes p such that p+/-2 are semiprimes. - Zak Seidov, Mar 08 2006

Examples

			A063643(25) = 751: 751 = A063637(60)= 753 - 2 = 3*251 - 2, 751 = A063638(55)= 749 + 2 = 7*107 + 2.
		

Crossrefs

Cf. A109611 (Chen primes).

Programs

  • Maple
    q:= p-> isprime(p) and map(numtheory[bigomega], {p-2, p+2})={2}:
    select(q, [$2..2000])[];  # Alois P. Heinz, Apr 01 2024
  • Mathematica
    Select[Prime[Range[300]], PrimeOmega[#+2] == PrimeOmega[#-2] == 2&] (* Jean-François Alcover, Mar 02 2019 *)
  • PARI
    { n=0; for (m=2, 10^9, p=prime(m); if (bigomega(p + 2) == 2 && bigomega(p - 2) == 2, write("b063643.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 26 2009

Formula

Intersection of A063637 and A063638. - Zak Seidov, Mar 14 2011

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

Original entry on oeis.org

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

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 14 2001

Keywords

Comments

This sequence is a subsequence of A107986, which only requires k to be composite. The first term in that sequence which is not in this sequence is 45, a number with three prime factors. - Alonso del Arte, May 03 2014

Crossrefs

Programs

  • Mathematica
    Select[ Range[ 2, 1500 ], Plus @@ Last@Transpose@FactorInteger[ # ] == 2 && PrimeQ[ # - 2 ] & ]
    Select[Range[700], PrimeOmega[#] == 2 && PrimeQ[# - 2]&] (* Harvey P. Dale, Mar 25 2013 *)
  • PARI
    { n=0; for (m=1, 10^9, a=prime(m) + 2; f=factor(a)~; if ((length(f)==1 && f[2, 1]==2) || (length(f)==2 && f[2, 1]==1 && f[2, 2]==1), write("b062721.txt", n++, " ", a); if (n==10000, break)) ) } \\ Harry J. Smith, Aug 09 2009

A189827 a(n) = d(n-1) + d(n+1), where d(k) is the number of divisors of k.

Original entry on oeis.org

3, 5, 4, 7, 4, 8, 5, 8, 5, 10, 4, 10, 6, 9, 6, 11, 4, 12, 6, 10, 6, 12, 5, 12, 7, 10, 6, 14, 4, 14, 6, 10, 8, 13, 6, 13, 6, 12, 6, 16, 4, 14, 8, 10, 8, 14, 5, 16, 7, 12, 6, 14, 6, 16, 8, 12, 6, 16, 4, 16, 8, 11, 10, 15, 6, 14, 6, 14, 6, 20, 4, 16, 8, 10, 10
Offset: 2

Views

Author

T. D. Noe, Apr 28 2011

Keywords

Comments

d(n-1) + d(n+1) is a measure of the compositeness of the numbers next to n. Sequence A189825 lists the first occurrence of each number.
It is conjectured that every number greater than 3 occurs an infinite number of times. Note that an infinite number of 4's is equivalent to there being an infinite number of twin primes (A001097). An infinite number of 5's is equivalent to there being an infinite number of primes of the form p^2-2 (A028871) or p^2+2 (A056899) for prime p. An infinite number of 6's is equivalent to there being an infinite number of primes of the form p^3-2 (A066878), p^3+2 (A048636), p*q-2 (A063637), or p*q+2 (A063638), where p and q are distinct primes.

Examples

			a(5) = d(4) + d(6) = 3 + 4 = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSigma[0,n-1] + DivisorSigma[0,n+1], {n, 2, 100}]
    First[#]+Last[#]&/@Partition[DivisorSigma[0,Range[80]],3,1] (* Harvey P. Dale, May 27 2013 *)

A115093 Primes of the form p*q-2, where p and q are distinct primes.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Mar 01 2006

Keywords

Comments

This sequence is a subset of A063637, which is the union of this sequence and A049002.

Crossrefs

Cf. A049002 (primes of the form p^2-2, where p is prime), A063637 (primes of the form p*q-2 where p and q are primes).

Programs

  • Mathematica
    SemiPrimeQ[n_] := (n>1) && (2==Plus@@(Transpose[FactorInteger[n]][[2]])); Select[Prime[Range[150]], SemiPrimeQ[ #+2] && !IntegerQ[Sqrt[ #+2]]&]

A176229 The smaller members p of cousin prime pairs (p,p+4) with a semiprime arithmetic mean p+2.

Original entry on oeis.org

7, 13, 19, 37, 67, 109, 127, 307, 379, 487, 499, 769, 877, 937, 1009, 1297, 1567, 2269, 2389, 2659, 2857, 3037, 3187, 3457, 3847, 3907, 3919, 4447, 4789, 4969, 4999, 5077, 5167, 5347, 5737, 6007, 6997, 7039, 7669, 8689, 8779, 9199, 10597, 11467, 11827
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Apr 12 2010

Keywords

Comments

By definition a subsequence of A063637 and of A023200.
The associated p+4 are members of A063638.
Because all members of A023200 are == 1 (mod 3), the semiprimes p+2 are all == 0 (mod 3), so one of their two factors is 3.
The least-significant digit (LSD) of p > 13 in A023200 is always 3, 7 or 9, but those with LSD equal to 3 demand p+2 to have LSD 5 and therefore divisor 5 which contradicts the semiprime property above, so 13 is the only member of the sequence with LSD equal to 3.

Examples

			7 = prime(4), 11 = prime(5), (7+11)/2 = 3^2 = semiprime(3), so 7 is in the sequence.
13 = prime(6), 17 = prime(7), (13+17)/3 = 3 * 5 = semiprime(6), so 13 is in the sequence.
19 = prime(8), 23 = prime(9), (19+23)/3 = 3 * 7 = semiprime(7), so 19 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    aQ[n_] := PrimeQ[n] && PrimeOmega[n + 2] == 2 && PrimeQ[n + 4]; Select[Range[12000], aQ] (* Amiram Eldar, Sep 08 2019 *)
    Select[Prime[Range[1500]],PrimeQ[#+4]&&PrimeOmega[#+2]==2&] (* Harvey P. Dale, May 15 2023 *)

A241659 Primes p such that p^3 + 2 is semiprime.

Original entry on oeis.org

2, 11, 13, 17, 19, 23, 31, 41, 53, 59, 89, 101, 131, 137, 149, 193, 211, 223, 227, 229, 233, 239, 251, 271, 293, 317, 331, 359, 401, 449, 461, 557, 563, 571, 593, 599, 619, 641, 659, 677, 691, 719, 739, 751, 809, 821, 853, 929, 971, 991, 1009, 1013, 1039, 1051
Offset: 1

Views

Author

K. D. Bajpai, Apr 26 2014

Keywords

Examples

			11 is prime and appears in the sequence because 11^3 + 2 = 1333 = 31 * 43, which is a semiprime.
17 is prime and appears in the sequence because 17^3 + 2 = 4915 =  5 * 983, which is a semiprime.
37 is prime but does not appear in the sequence because 37^3 + 2 = 50655 =  3 * 5 * 11 * 983, which is not a semiprime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): KD:= proc() local a, b, k; k:=ithprime(n); a:=bigomega(k^3+2); if a=2 then RETURN (k); fi; end: seq(KD(), n=1..500);
  • Mathematica
    A241659 = {}; Do[t = Prime[n]; If[PrimeOmega[t^3 + 2] == 2, AppendTo[A241659, t]], {n, 500}]; A241659
    (*For the b-file*) c = 0; Do[t = Prime[n]; If[PrimeOmega[t^3 + 2] == 2, c++; Print[c, "  ", t]], {n, 1,6*10^4}];
    Select[Prime[Range[200]],PrimeOmega[#^3+2]==2&] (* Harvey P. Dale, Feb 05 2025 *)
  • PARI
    s=[]; forprime(p=2, 1200, if(bigomega(p^3+2)==2, s=concat(s, p))); s \\ Colin Barker, Apr 27 2014

A207526 Primes p such that p-2 or p+2 are semiprimes.

Original entry on oeis.org

2, 7, 11, 13, 17, 19, 23, 31, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 109, 113, 127, 131, 139, 157, 163, 167, 179, 181, 199, 211, 223, 233, 239, 251, 257, 263, 269, 293, 307, 311, 317, 331, 337, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 439
Offset: 1

Views

Author

Keywords

Examples

			2+2=2^2(semiprime), 7+2=3^2(semiprime), 11-2=3^2(semiprime), 13+2=3*5(semiprime), 17-2=3*5(semiprime)
		

Crossrefs

Programs

  • Mathematica
    Select[Table[Prime[n], {n,200}], (Last /@ FactorInteger[#-2] == {1,1} || Last /@ FactorInteger[#-2] == {2}) || (Last /@ FactorInteger[#+2] == {1,1} || Last /@ FactorInteger[#+2] == {2}) &]

A241716 Primes p such that p^3 - 2 is semiprime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 41, 43, 47, 61, 79, 89, 101, 107, 139, 157, 181, 199, 239, 271, 307, 311, 331, 337, 347, 349, 379, 397, 409, 421, 431, 479, 487, 499, 521, 523, 541, 571, 607, 613, 641, 643, 661, 673, 701, 719, 761, 769, 811, 823, 829, 839, 877, 881, 883
Offset: 1

Views

Author

K. D. Bajpai, Apr 27 2014

Keywords

Examples

			11 is prime and appears in the sequence because 11^3 - 2 = 1329 = 3 * 443, which is a semiprime.
17 is prime and appears in the sequence because 17^3 - 2 = 4911 = 3 * 1637, which is a semiprime.
23 is prime but does not appear in the sequence because 23^3 - 2 = 12165 =  3 * 5 * 811, which is not a semiprime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A241716:= proc() local k; k:=ithprime(x); if bigomega(k^3-2)=2 then RETURN (k); fi; end: seq(A241716(), x=1..500);
  • Mathematica
    A241716 = {}; Do[t = Prime[n]; If[PrimeOmega[t^3 - 2] == 2, AppendTo[A241716, t]], {n, 500}]; A241716
    Select[Prime[Range[200]],PrimeOmega[#^3-2]==2&] (* Harvey P. Dale, Dec 09 2018 *)
Showing 1-10 of 19 results. Next