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 15 results. Next

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

A166081 Natural numbers that are not the sum of two distinct primes.

Original entry on oeis.org

1, 2, 3, 4, 6, 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53, 57, 59, 65, 67, 71, 77, 79, 83, 87, 89, 93, 95, 97, 101, 107, 113, 117, 119, 121, 123, 125, 127, 131, 135, 137, 143, 145, 147, 149, 155, 157, 161, 163, 167, 171, 173, 177, 179, 185, 187, 189, 191, 197, 203
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 06 2009

Keywords

Comments

All numbers that appear in A014092 are also in this sequence, by definition.
It seems that, for n > 6, the reverse is also true, however this is unproved. - Ely Golden, Dec 25 2016
All numbers that appear in this sequence but not A014092 must be even semiprimes with no other partitions into primes. - Ely Golden, Dec 25 2016

Crossrefs

Cf. A117929, A006881, A038609 (complement), A014092, A066615.

Programs

  • Mathematica
    Select[Range@ 204, Length@Select[Transpose@{#, Reverse@ # - 1} &@ Range[#] &@ #, Times @@ Boole@ Map[PrimeQ, #] == 1 && First@ # != Last@ # &] == 0 &] (* Michael De Vlieger, Apr 24 2016 *)
    max = 1000;
    ip = PrimePi[max];
    A038609 = Table[Prime[i] + Prime[j], {i, ip}, {j, i + 1, ip}] // Flatten // Union // Select[#, # <= max&]&;
    Complement[Range[max], A038609] (* Jean-François Alcover, Mar 24 2020 *)

Formula

{1} U A025584 U A109934. - R. J. Mathar, Oct 08 2009
A000027 \ A038609. - R. J. Mathar, Oct 14 2009

A068873 Smallest prime which is a sum of n distinct primes.

Original entry on oeis.org

2, 5, 19, 17, 43, 41, 79, 83, 127, 131, 199, 197, 283, 281, 379, 389, 499, 509, 643, 641, 809, 809, 983, 971, 1171, 1163, 1381, 1373, 1609, 1607, 1861, 1861, 2137, 2137, 2437, 2441, 2749, 2767, 3109, 3109, 3457, 3457, 3833, 3847, 4243, 4241, 4663, 4679, 5119
Offset: 1

Views

Author

Amarnath Murthy, Mar 19 2002

Keywords

Comments

Conjectured terms a(50)-a(76): 5147, 5623, 5591, 6079, 6101, 6599, 6607, 7151, 7151, 7699, 7699, 8273, 8293, 8893, 8893, 9521, 9547, 10211, 10223, 10889, 10891, 11597, 11617, 12343, 12373, 13099, 13127. - Jean-François Alcover, Apr 22 2020

Examples

			a(3) = 19 as 19 is the smallest prime which can be expressed as the sum of three primes as 19 = 3 + 5 + 11.
a(4) = 17= 2+3+5+7. a(2)=A038609(1). a(3)=A124867(7). Further examples in A102330.
		

References

  • Shantanu Dey & Moloy De, Two conjectures on prime numbers, Journal of Recreational Mathematics, Vol. 36 (3), pp 205-206. Baywood Publ. Co, Amityville NY 2011.

Crossrefs

Programs

  • Maple
    # Number of ways to write n as a sum of k distinct primes, the smallest
    # being smalp
    sumkprims := proc(n,k,smalp)
        option remember;
        local a,res,pn;
        res := n-smalp ;
        if res < 0 then
            return 0;
        elif res > 0 and k <=0 then
            return 0;
        elif res = 0 and k = 1 then
            return 1;
        else
            pn := nextprime(smalp) ;
            a := 0 ;
            while pn <= res do
                a := a+procname(res,k-1,pn) ;
                pn := nextprime(pn) ;
            end do:
            a ;
        end if;
    end proc:
    # Number of ways of writing n as a sum of k distinct primes
    A000586k := proc(n,k)
        local a,i,smalp ;
        a := 0 ;
        for i from 1 do
            smalp := ithprime(i) ;
            if k*smalp > n then
                return a;
            end if;
            a := a+sumkprims(n,k,smalp) ;
        end do:
    end proc:
    # Smallest prime which is a sum of n distinct primes
    A068873 := proc(n)
        local a,i;
        a := A007504(n) ;
        a := nextprime(a-1) ;
        for i from 1 do
            if A000586k(a,n) > 0 then
                return a;
            end if;
            a := nextprime(a) ;
        end do:
    end proc: # R. J. Mathar, May 04 2014
  • PARI
    a(n)=
    {
        my(P=primes(n), k=n, t, res = oo);
        while(1,
            forvec(v=vector(n-1, i, [1, k-1]),
                t=sum(i=1, n-1, P[v[i]])+P[k];
                if(isprime(t),
    		res = min(res, t);
    	   )
            ,
                2 \\ flag: only strictly increasing vectors v
            );
            P=concat(P, nextprime(P[k]+1));
            k++;
    	if(P[k] + sum(i = 1+bitand(n,1), n-1+bitand(n,1), P[i]) > res,
    		return(res)
    	)
        );
    }
    \\ Charles R Greathouse IV, Sep 19 2015; corrected by David A. Corneth, May 12 2025

Formula

Min(a(n), A073619(n)) = A007504(n) for n > 1. - Jonathan Sondow, Jul 10 2012

Extensions

More terms from Sascha Kurz, Feb 03 2003
Corrected by Ray Chandler, Feb 02 2005

A177689 Sums of 2 distinct primorials.

Original entry on oeis.org

3, 7, 8, 31, 32, 36, 211, 212, 216, 240, 2311, 2312, 2316, 2340, 30031, 30032, 30036, 30060, 30240, 32340, 510511, 510512, 510516, 510540, 510720, 512820, 540540, 9699691, 9699692, 9699696, 9699720, 9699900, 9702000, 9729720, 10210200
Offset: 1

Views

Author

Jonathan Vos Post, May 11 2010

Keywords

Comments

This is to numbers that are the sum of 2 different primes (A038609) as primorials (A002110) are to primes (A000040). The subsequence of primes among these sums of 2 distinct primorials is the sequence of primorial primes (A018239) which is the same as the subsequence of primes among the Euclid numbers (A006862).

Crossrefs

Formula

{a(n)} = {A002110(i) + A002110(j) for i =/= j}.

A238397 Numbers of the form pq + qr + rp where p, q and r are distinct primes (sorted sequence without duplicates).

Original entry on oeis.org

31, 41, 59, 61, 71, 87, 91, 101, 103, 113, 119, 121, 129, 131, 143, 151, 161, 167, 171, 185, 191, 199, 211, 213, 215, 221, 227, 239, 241, 243, 247, 251, 263, 269, 271, 275, 281, 293, 297, 299, 301, 311, 321, 327, 331, 339, 341, 343, 347, 355
Offset: 1

Views

Author

Jean-François Alcover, Feb 26 2014

Keywords

Comments

Numbers of the form e2(p, q, r) for distinct primes p, q, r, where e2 is the elementary symmetric polynomial of degree 2. Other sequences are obtained with different numbers of distinct primes and degrees: A000040 for 1 prime, A038609 and A006881 for 2 primes, A124867, this sequence, and A007304 for 3 primes. The 4-prime sequences are not presently in the OEIS with the exception of A046386. - Charles R Greathouse IV, Feb 26 2014

Examples

			71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2 is in the sequence (only once, though 2 solutions exist).
		

Crossrefs

Programs

  • Mathematica
    terms = 50; dm (* initial number of primes *) = 10; f[p_, q_, r_] := p*q + q*r + r*p; Clear[A238397]; A238397[m_] := A238397[m] = Take[u = Union[f @@@ Subsets[Prime /@ Range[m], {3}]], Min[Length[u], terms]]; A238397[dm]; A238397[m = 2*dm]; While[Print["m = ", m]; A238397[m] != A238397[m - dm], m = m + dm]; A238397[m]
  • PARI
    is(n)=forprime(r=(sqrtint(3*n-3)+5)\3, (n-6)\5, forprime(q= sqrtint(r^2+n)-r+1, min((n-2*r)\(r+2), r-2), if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)), return(1)))); 0 \\ Charles R Greathouse IV, Feb 26 2014
    
  • PARI
    list(n)=my(v=List()); forprime(r=5, (n-6)\5, forprime(q=3, min((n-2*r)\(r+2), r-2), my(S=q+r, P=q*r); forprime(p=2, min((n-P)\S, q-1), listput(v, p*S+P)))); Set(v) \\ Charles R Greathouse IV, Feb 26 2014

A124884 Largest number that is not a sum of n distinct primes, or -1 if such a number does not exist.

Original entry on oeis.org

-1, -1, 17, 30, 41, 60, 83, 102, 137, 162, 203, 244, 293, 334, 389, 448, 515, 574, 647, 724, 803, 884, 977, 1066, 1163, 1276, 1373, 1492, 1607, 1738, 1865, 2002, 2141, 2290, 2435, 2602, 2759, 2932, 3095, 3280, 3467, 3646, 3857, 4054, 4247, 4456, 4683, 4912, 5141, 5374
Offset: 1

Views

Author

Alexander Adamchuk, Nov 12 2006

Keywords

Examples

			a(1) = -1 because there are an infinite number of nonprimes.
a(3) = 17 because 17 = Max[{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17}] = Max[A124868(n)], where A124868(n) are the natural numbers that are not the sum of 3 distinct primes.
		

Crossrefs

Number of natural numbers that are not a sum of n distinct primes, or -1 if it is infinite, are listed in A124885(n) = {-1, -1, 12, 22, 34, 49, 68, 90, 117, 147, 180, 219, ...}.
Natural numbers that are not the sum of 2 distinct primes are {1 - 4, 6, 11, 17, 23, 27, 29, 35, 37, 41, 47, ...}, complement to A038609(n)
Numbers that are the sum of 2 different primes.
Natural numbers that are not the sum of 3 distinct primes A124868(n) = {1 - 9, 11, 13, 17}.
Natural numbers that are not the sum of 4 distinct primes are {1 - 16, 18, 19, 20, 22, 24, 30}.
Natural numbers that are not the sum of 5 distinct primes are {1 - 27, 29, 31, 32, 33, 35, 37, 41}.
Natural numbers that are not the sum of 6 distinct primes are {1 - 40, 42, 43, 44, 46, 48, 50, 52, 54, 60}.
Natural numbers that are not the sum of 7 distinct primes are {1 - 57, 59, 61, 62, 63, 65, 67, 69, 71, 73, 77, 83}.
Natural numbers that are not the sum of 8 distinct primes are {1 - 76, 78, 79, 80, 82, 84, 85, 86, 88, 90, 92, 94, 96, 100, 102}.
Natural numbers that are not the sum of 9 distinct primes are {1 - 99, 101, 102, 103, 104, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 131, 133, 137}.
Natural numbers that are not the sum of 10 distinct primes are {1 - 128, 130, 132, 133, 134, 135, 136, 138, 139, 140, 142, 144, 146, 148, 150, 152, 154, 156, 160, 162}.
Natural numbers that are not the sum of 11 distinct primes are {1 - 159, 161, 162, 163, 164, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 197, 203}.
Natural numbers that are not the sum of 12 distinct primes are {1 - 196, 198, 199, 200, 202, 204, 205, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 240, 244}.

Programs

  • PARI
    print1("-1,-1,");for(n=3,50,L=0;for(i=1,n,L+=prime(i));L*=2;a=matrix(n,L,i,j,0);forprime(p=2,L,forstep(i=n,2,-1,for(j=p+1,L,if(a[i-1,j-p],a[i,j]=1)));a[1,p]=1);r=L;while(a[n,r],r--);print1(r","))

Extensions

a(13)-a(50) from Robert Gerbicz, Nov 22 2010

A177697 Sums of 3 distinct primorials.

Original entry on oeis.org

9, 33, 37, 38, 213, 217, 218, 241, 242, 246, 2313, 2317, 2318, 2341, 2342, 2346, 2521, 2522, 2526, 2550, 30033, 30037, 30038, 30061, 30062, 30066, 30241, 30242, 30246, 30270, 32341, 32342, 32346, 32370, 32550, 510513, 510517, 510518, 510541, 510542
Offset: 1

Views

Author

Jonathan Vos Post, May 11 2010

Keywords

Comments

This is to numbers that are the sum of 3 different primes (A124867) as primorials (A002110) are to primes (A000040). The subsequence of primes among these sums of 3 distinct primorials begins: 37, 241, 2341, 2521, 30241, 32341, 512821, 540541.

Examples

			9 = 6+2+1
33 = 30+2+1
37 = 30+6+1
38 = 30+6+2
213 = 210+2+1
		

Crossrefs

Programs

  • Mathematica
    Take[Total/@Subsets[Join[{1},FoldList[Times,Prime[Range[10]]]],{3}]// Union,40] (* Harvey P. Dale, Nov 07 2017 *)

Formula

{a(n)} = {A002110(i) + A002110(j) + A002110(k) for i =/= j, i =/= k, j =/= k}.

A124885 Number of natural numbers that are not a sum of n distinct primes, or -1 if it is infinite.

Original entry on oeis.org

-1, -1, 12, 22, 34, 49, 68, 90, 117, 147, 180, 219
Offset: 1

Views

Author

Alexander Adamchuk, Nov 12 2006

Keywords

Comments

A124884(n) = {-1, -1, 17, 30, 41, 60, 83, 102, 137, 162, 203, 244, ...} Largest number that is not a sum of n distinct primes, or -1 if such a number does not exist.
Natural numbers that are not the sum of 2 distinct primes are {1 - 4, 6, 11, 17, 23, 27, 29, 35, 37, 41, 47, ...}, complement to A038609(n)
Numbers that are the sum of 2 different primes.
Natural numbers that are not the sum of 3 distinct primes A124868(n) = {1 - 9, 11, 13, 17}.
Natural numbers that are not the sum of 4 distinct primes are {1 - 16, 18, 19, 20, 22, 24, 30}.
Natural numbers that are not the sum of 5 distinct primes are {1 - 27, 29, 31, 32, 33, 35, 37, 41}.
Natural numbers that are not the sum of 6 distinct primes are {1 - 40, 42, 43, 44, 46, 48, 50, 52, 54, 60}.
Natural numbers that are not the sum of 7 distinct primes are {1 - 57, 59, 61, 62, 63, 65, 67, 69, 71, 73, 77, 83}.
Natural numbers that are not the sum of 8 distinct primes are {1 - 76, 78, 79, 80, 82, 84, 85, 86, 88, 90, 92, 94, 96, 100, 102}.
Natural numbers that are not the sum of 9 distinct primes are {1 - 99, 101, 102, 103, 104, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 131, 133, 137}.
Natural numbers that are not the sum of 10 distinct primes are {1 - 128, 130, 132, 133, 134, 135, 136, 138, 139, 140, 142, 144, 146, 148, 150, 152, 154, 156, 160, 162}.
Natural numbers that are not the sum of 11 distinct primes are {1 - 159, 161, 162, 163, 164, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 197, 203}.
Natural numbers that are not the sum of 12 distinct primes are {1 - 196, 198, 199, 200, 202, 204, 205, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 240, 244}.

Examples

			a(1) = -1 because there are an infinite number of nonprimes.
a(3) = 12 because 12 = Length[{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17}] = Length[A124868(n)], where A124868(n) are the natural numbers that are not the sum of 3 distinct primes.
		

Crossrefs

A157724 Numbers that are the sum of two distinct primes but are not twice a prime.

Original entry on oeis.org

5, 7, 8, 9, 12, 13, 15, 16, 18, 19, 20, 21, 24, 25, 28, 30, 31, 32, 33, 36, 39, 40, 42, 43, 44, 45, 48, 49, 50, 52, 54, 55, 56, 60, 61, 63, 64, 66, 68, 69, 70, 72, 73, 75, 76, 78, 80, 81, 84, 85, 88, 90, 91, 92, 96, 98, 99, 100, 102, 103, 104, 105, 108, 109, 110, 111, 112, 114, 115
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2010

Keywords

Examples

			10 = 3+7 is not a member since also 10 = 2*5.
		

Crossrefs

Cf. A038609.

A177709 Sums of 4 distinct primorials.

Original entry on oeis.org

39, 219, 243, 247, 248, 2319, 2343, 2347, 2348, 2523, 2527, 2528, 2551, 2552, 2556, 30039, 30063, 30067, 30068, 30243, 30247, 30248, 30271, 30272, 30276, 32343, 32347, 32348, 32371, 32372, 32376, 32551, 32552, 32556, 32580, 510519, 510543
Offset: 1

Views

Author

Jonathan Vos Post, May 11 2010

Keywords

Comments

This is to numbers that are the sum of 4 different primes (A177708) as primorials (A002110) are to primes (A000040). The subsequence of primes among these sums of 4 distinct primorials begins: 2347, 2551, 30271, 32371, 510751. The subsequence of nontrivial powers a^b with b>1 begin: a(3) = 243, a(24) = 30276 = 30030+210+30+6 = 2^2 x 3^2 x 29^2.

Examples

			a(1) = 39 = 30+6+2+1
a(2) = 219 = 210+6+2+1
a(3) = 243 = 210+30+2+1 = 3^5
a(4) = 247 = 210+30+6+1
a(5) = 248 = 210+30+6+2.
		

Crossrefs

Formula

{a(n)} = {A002110(i) + A002110(j) + A002110(k)+ A002110(L) for distinct i, j, k, L}.

Extensions

Corrected (2348 inserted) by R. J. Mathar, May 15 2010
Showing 1-10 of 15 results. Next