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

A006512 Greater of twin primes.

Original entry on oeis.org

5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489, 1609
Offset: 1

Views

Author

Keywords

Comments

Also primes that are the sum of two primes (which is possible only if 2 is one of the primes). - Cino Hilliard, Jul 02 2004, edited by M. F. Hasler, Nov 14 2019
The set of greater of twin primes larger than five is a proper subset of the set of primes of the form 3n + 1 (A002476). - Paul Muljadi, Jun 05 2008
Smallest prime > n-th isolated composite. - Juri-Stepan Gerasimov, Nov 07 2009
Subsequence of A175075. Union of a(n) and sequence A175080 is A175075. - Jaroslav Krizek, Jan 30 2010
A164292(a(n))=1; A010051(a(n)+2)=0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
Omega(n) = Omega(n-2); d(n) = d(n-2). - Juri-Stepan Gerasimov, Sep 19 2010
Aside from the first term, all subsequent terms have digital root 1, 4, or 7. - J. W. Helkenberg, Jul 24 2013
Also primes p with property that the sum of the successive gaps between primes <= p is a prime number. - Robert G. Wilson v, Dec 19 2014
The phrase "x is an element of the {primes, positive integers} and there {exist no, exist} elements a,b of {1 and primes, primes}: a+b=x" determines A133410, A067829, A025584, A006512, A166081, A014092, A014091 and A038609 for the first few hundred terms with only de-duplication or omitting/including 3, 4 and 6 in the case of A166081/A014091 and one case of omitting/including 3 given 1 isn't prime. - Harry G. Coin, Nov 25 2015
The yet unproved Twin Prime Conjecture states that this sequence is infinite. - M. F. Hasler, Nov 14 2019

References

  • See A001359 for further references and links.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A139690.
Bisection of A077800.

Programs

  • Haskell
    a006512 = (+ 2) . a001359 -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610)|IsPrime(n-2)]; // Bruno Berselli, Feb 28 2011
    
  • Maple
    for i from 1 to 253 do if ithprime(i+1) = ithprime(i) + 2 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
    P := select(isprime,[$1..1609]): select(p->member(p-2,P),P); # Peter Luschny, Mar 03 2011
    A006512 := proc(n)
        2+A001359(n) ;
    end proc: # R. J. Mathar, Nov 26 2014
  • Mathematica
    Select[Prime[Range[254]], PrimeQ[# - 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    Transpose[Select[Partition[Prime[Range[300]], 2, 1], Last[#] - First[#] == 2 &]][[2]] (* Harvey P. Dale, Nov 02 2011 *)
    Cases[Prime[Range[500]] + 2, ?PrimeQ] (* _Fred Patrick Doty, Aug 23 2017 *)
  • PARI
    select(p->isprime(p-2),primes(1000))
    
  • PARI
    a(n)=p=3; while(p+2 < (p=nextprime(p+1)) || n-->0, ); p
    vector(100, n, a(n)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n - 2)]) # Indranil Ghosh, Jul 20 2017

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

A037143 Numbers with at most 2 prime factors (counted with multiplicity).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 25, 26, 29, 31, 33, 34, 35, 37, 38, 39, 41, 43, 46, 47, 49, 51, 53, 55, 57, 58, 59, 61, 62, 65, 67, 69, 71, 73, 74, 77, 79, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 101, 103, 106, 107, 109, 111, 113, 115, 118
Offset: 1

Views

Author

Keywords

Comments

A001222(a(n)) <= 2; A054576(a(n)) = 1. - Reinhard Zumkeller, Mar 10 2006
Products of two noncomposite numbers. - Juri-Stepan Gerasimov, Apr 15 2010
Also, numbers with permutations of all divisors only with coprime adjacent elements: A109810(a(n)) > 0. - Reinhard Zumkeller, May 24 2010
A060278(a(n)) = 0. - Reinhard Zumkeller, Apr 05 2013
1 together with numbers k such that sigma(k) + phi(k) - d(k) = 2k - 2. - Wesley Ivan Hurt, May 03 2015
Products of two not necessarily distinct terms of A008578 (the same relation between A000040 and A001358). - Flávio V. Fernandes, May 28 2021

Crossrefs

Union of A008578 and A001358. Complement of A033942.
A101040(a(n))=1 for n>1.
Subsequence of A037144. - Reinhard Zumkeller, May 24 2010
A098962 and A139690 are subsequences.

Programs

  • Haskell
    a037143 n = a037143_list !! (n-1)
    a037143_list = 1 : merge a000040_list a001358_list where
       merge xs'@(x:xs) ys'@(y:ys) =
             if x < y then x : merge xs ys' else y : merge xs' ys
    -- Reinhard Zumkeller, Dec 18 2012
    
  • Maple
    with(numtheory): A037143:=n->`if`(bigomega(n)<3,n,NULL): seq(A037143(n), n=1..200); # Wesley Ivan Hurt, May 03 2015
  • Mathematica
    Select[Range[120], PrimeOmega[#] <= 2 &] (* Ivan Neretin, Aug 16 2015 *)
  • PARI
    is(n)=bigomega(n)<3 \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A037143(n):
        def f(x): return int(n-2+x-primepi(x)-sum(primepi(x//k)-a for a,k in enumerate(primerange(isqrt(x)+1))))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 23 2024

Extensions

More terms from Henry Bottomley, Aug 15 2001

A052147 a(n) = prime(n) + 2.

Original entry on oeis.org

4, 5, 7, 9, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk), Jan 24 2000

Keywords

Comments

A048974, A052147, A067187 and A088685 are very similar after dropping terms less than 13. - Eric W. Weisstein, Oct 10 2003
A117530(n,2) = a(n) for n>1. - Reinhard Zumkeller, Mar 26 2006
a(n) = A000040(n) + 2 = A008864(n) + 1 = A113395(n) - 1 = A175221(n) - 2 = A175222(n) - 3 = A139049(n) - 4 = A175223(n) - 5 = A175224(n) - 6 = A140353(n) - 7 = A175225(n) - 8. - Jaroslav Krizek, Mar 06 2010
Left edge of the triangle in A065342. - Reinhard Zumkeller, Jan 30 2012
Union of A006512 and A107986. - David James Sycamore, Jul 08 2018

Crossrefs

A139690 is a subsequence.

Programs

A139689 If (n-th Chen prime) + 2 is a prime then 1 else 0.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 29 2008

Keywords

Crossrefs

Formula

a(n) = 2 - A001222(A139690(n)).
a(n) = A010051(A139690(n)) = 1 - A064911(A139690(n)).
Showing 1-5 of 5 results.