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

A125688 Number of partitions of n into three distinct primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 4, 3, 4, 2, 5, 3, 5, 4, 6, 1, 6, 3, 6, 4, 6, 3, 9, 3, 8, 5, 8, 4, 11, 3, 11, 5, 10, 3, 13, 3, 13, 6, 12, 2, 14, 5, 15, 6, 13, 2, 18, 5, 17, 6, 14, 4, 21, 5, 19, 7, 17, 4, 25, 4, 20, 8, 21, 4, 26, 4, 25, 9, 22, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 30 2006

Keywords

Comments

a(A124868(n)) = 0; a(A124867(n)) > 0;
a(A125689(n)) = n and a(m) <> n for m < A125689(n).

Examples

			a(42) = #{2+3+37, 2+11+29, 2+17+23} = 3.
		

Crossrefs

Column k=3 of A219180. - Alois P. Heinz, Nov 13 2012

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, [1,0$3], `if`(i<1, [0$4],
           zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$3],
           b(n-ithprime(i), i-1)[1..3])[]], 0)))
        end:
    a:= n-> b(n, numtheory[pi](n))[4]:
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 15 2012
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, {1, 0, 0, 0}, If[i<1, {0, 0, 0, 0}, Plus @@ PadRight[{b[n, i-1], Join[{0}, If[Prime[i]>n, {0, 0, 0}, Take[b[n-Prime[i], i-1], 3]]]}]]]; a[n_] := b[n, PrimePi[n]][[4]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
    dp3Q[{a_,b_,c_}]:=Length[Union[{a,b,c}]]==3&&AllTrue[{a,b,c},PrimeQ]; Table[ Count[IntegerPartitions[n,{3}],?dp3Q],{n,100}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Jan 30 2019 *)
  • PARI
    a(n)=my(s);forprime(p=n\3,n-4,forprime(q=(n-p)\2+1,min(n-p,p-1),if(isprime(n-p-q),s++)));s \\ Charles R Greathouse IV, Aug 27 2012

Formula

From Alois P. Heinz, Nov 22 2012: (Start)
G.f.: Sum_{0
a(n) = [x^n*y^3] Product_{i>=1} (1+x^prime(i)*y). (End)
a(n) = Sum_{k=1..floor((n-1)/3)} Sum_{i=k+1..floor((n-k-1)/2)} A010051(i) * A010051(k) * A010051(n-i-k). - Wesley Ivan Hurt, Mar 29 2019

A124867 Numbers that are the sum of 3 distinct primes.

Original entry on oeis.org

10, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Comments

(Conjecture) Every number n > 17 is the sum of 3 distinct primes. Natural numbers that are not the sum of 3 distinct primes are listed in A124868.
A125688(a(n)) > 0. - Reinhard Zumkeller, Nov 30 2006

Examples

			The first three primes are 2, 3, 5, and 2 + 3 + 5 = 10, so 10 is in the sequence. No smaller integer is in the sequence.
5 + 5 + 5 = 15, but note also 3 + 5 + 7 = 15, so 15 is in the sequence.
Although 13 = 3 + 3 + 7 = 3 + 5 + 5, both of those repeat primes, so 13 is not in the sequence.
		

Crossrefs

Cf. A124868 (not the sum of 3 distinct primes), A068307, A125688.

Programs

  • Mathematica
    threePrimes[n_] := Module[{p, q, r}, {p, q, r} /. Solve[n == p + q + r && p < q < r, {p, q, r}, Primes]];
    Reap[For[n = 10, n <= 100, n++, sol = threePrimes[n]; If[MatchQ[sol, {{, , }..}], Print[n, " ", sol[[1]]]; Sow[n]]]][[2, 1]] (* _Jean-François Alcover, Apr 26 2020 *)
    has3DistPrimesPart[n_] := Length[Select[IntegerPartitions[n, {3}], Length[Union[#]] == 3 && Union[PrimeQ[#]] == {True} &]] > 0; Select[Range[100], has3DistPrimesPart] (* Alonso del Arte, Apr 26 2020 *)
    Union[Total/@Subsets[Prime[Range[20]],{3}]] (* Harvey P. Dale, Feb 06 2024 *)
  • PARI
    a(n)=if(n>5,n+12,[10, 12, 14, 15, 16][n]) \\ Charles R Greathouse IV, Aug 26 2011

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

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

A066615 Numbers that are not the sum of two or three distinct primes.

Original entry on oeis.org

1, 2, 3, 4, 6, 11, 17
Offset: 1

Author

Amarnath Murthy, Dec 24 2001

Keywords

Comments

Probably there are no further terms.
An outgrowth of Goldbach's conjecture. "[I]n a letter to L. Euler (1742), C. F. Goldbach [asserted] that 'every odd number greater than 6 is equal to the sum of three primes.' Euler replied that Goldbach's conjecture was equivalent to the statement that every even number equal to or greater than 4 is equal to the sum of two primes. Because proving the second implies the first, but not the converse, most attention has been focused on the second representation. However, whether the statement is true for all even integers is still unsettled. Nevertheless, it is supported by existing evidence. A Russian mathematician, I. M. Vinogradov, proved that all large odd integers are the sum of three primes. Surprisingly, his techniques involve extremely subtle use of the theory of complex variables; no one has been able to extend them in order to solve Goldbach's conjecture." Andrews.
"Every number greater than 17 is the sum of 3 integers greater than 1 which are relatively prime in pairs." - Wells.

References

  • George E. Andrews, "Number Theory," Dover Publ. Inc., NY, 1994, page 111.
  • Calvin C. Clawson, "Mathematical Mysteries, the beauty and magic of numbers," Perseus Books, Cambridge, MA, 1996, Chapter 12, Pages 236-257.
  • Mark Herkommer, "Number Theory, A Programmer's Guide," McGraw-Hill, NY, 1999, pages 359-362.
  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, "An Introduction to The Theory of Numbers," Fifth Edition, John Wiley & Sons, Inc. NY, 1991, page 2.
  • Wacław Sierpiński, "250 Problems in Elementary Number Theory," New York: American Elsevier, Warsaw, 1970, pp. 4, 38-39.
  • David Wells, "The Penguin Dictionary of Curious and Interesting Numbers," Revised Edition, Penguin Books, London, 1997, page 76.

Crossrefs

Intersection of A166081 and A124868.

Programs

  • Mathematica
    a = Table[ Prime[n], {n, 1, 100}]; b = {0}; Do[ b = Append[b, a[[i]] + a[[j]]], {j, 2, 100}, {i, 1, j - 1}]; Union[b]; c = {0}; Do[ c = Append[c, a[[i]] + a[[j]] + a[[k]]], {k, 3, 100}, {j, 2, k - 1}, {i, 1, j - 1}]; Union[c]; Complement[ Table[n, {n, 1, 541} ], Union[b, c]]

Extensions

Entry revised by Robert G. Wilson v, Dec 27 2001

A100590 Duplicate of A096218.

Original entry on oeis.org

19, 29, 43, 59, 73, 89, 103, 127, 149, 167, 193, 223, 277, 317, 359, 461, 509, 523, 593, 643, 797, 823, 877, 1019, 1123, 1153, 1297, 1327, 1367, 1409, 1493, 1543, 1559, 1613, 1667, 1753, 1777, 1811, 1847, 1877, 1993, 2099, 2203, 2293, 2309, 2411, 2503, 2609
Offset: 1

Author

Keywords

Comments

Name was: Primes of the form 3p+2q, p and q consecutive primes, which are also the sum of three distinct primes.
Duplicate of A096218 (because it's identical to A096218 for terms < 18 and A124868 has no terms > 17). - R. J. Mathar, Jun 06 2014

Crossrefs

Subsequence of A096218.

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

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

A178041 Number of ways to represent the n-th prime (which has a nonzero number of such representations) as the sum of 4 distinct primes.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 6, 6, 8, 10, 13, 14, 13, 18, 21, 17, 21, 30, 21, 32, 23, 37, 27, 45, 35, 34, 54, 43, 60, 61, 67, 44, 52, 55, 79, 58, 89, 57, 92, 100, 111, 69, 119, 76, 83, 122, 91, 89, 94, 102, 147, 146, 106, 159, 116, 176, 125, 190, 119, 195, 202, 136, 230, 148, 154, 222
Offset: 1

Author

Jonathan Vos Post, May 17 2010

Keywords

Examples

			a(1) = 1 because 17 = 2+3+5+7 is the unique solution for the smallest such prime.
a(2) = 2 because 23 = 2+3+5+13 = 2+3+7+11 are the only two solutions for the 2nd smallest such prime.
a(3) = 3 because 29 = 2+3+5+19 = 2+3+7+17 = 2+3+11+13 are the only 3 solutions for the 3rd smallest such prime.
a(4) = 3 because 31 = 2+3+7+19 = 2+5+7+17 = 2+5+11+13 are the only 3 solutions for the 4th smallest such prime.
a(5) = 5 because 37 = 2+3+13+19 = 2+5+7+23 = 2+5+11+19 = 2+5+13+17 = 2+7+11+17 are the only 5 solutions for the 5th smallest such prime.
		

Crossrefs

Cf. A000040, A038609 (sum of 2 distinct primes), A124867 (sum of 3 distinct primes), A124868 (not the sum of 3 distinct primes), A124884 (not the sum of n distinct primes).

Programs

  • Mathematica
    max=367;lim=PrimePi[max];p4=Sort[Total/@Subsets[Prime[Range[lim]],{4}]];p4p=Select[p4,PrimeQ[#]&&#<=max&]; s={};Do[c=Count[p4p,Prime[p]];If[c>0,AppendTo[s,c]],{p,lim}];s (* James C. McMahon, Jan 11 2025 *)

Extensions

Extended by Zak Seidov

A329590 Odd numbers k that cannot be expressed as k = p+q+r, with p prime and (q, r) a pair of twin primes.

Original entry on oeis.org

1, 3, 5, 7, 9, 33, 57, 93, 99, 129, 141, 153, 177, 183, 195, 213, 225, 243, 255, 261, 267, 273, 297, 309, 327, 333, 351, 369, 393, 411, 423, 435, 453, 477, 489, 501, 513, 519, 525, 537, 561, 573, 591, 597, 603, 633, 645, 657, 663, 675, 687, 693, 705, 711, 723
Offset: 1

Author

Antonio Roldán, Feb 13 2020

Keywords

Examples

			33 can be expressed as the sum of three primes in 9 different ways:
33 = 11 + 11 + 11 = 13 + 13 + 7 = 17 + 11 + 5 = 17 + 13 + 3 = 19 + 7 + 7 = 19 + 11 + 3 = 23 + 5 + 5 = 23 + 7 + 3 = 29 + 2 + 2;
there is no pair of twin primes in the addends, so 33 is a term.
		

Crossrefs

Programs

  • PARI
    for(n = 0, 500, m = 2*n+1; v = 0; forprime(i = 3, m-8, j = (m-i)/2; if(isprime(j-1) && isprime(j+1), v = 1)); if(v == 0, print1(m,", ")))
    
  • PARI
    isok(k) = {if (! (k % 2), return (0)); forprime(p=3, k, if (isprime((k-p)\2-1) && isprime((k-p)\2+1), return(0));); return (1);} \\ Michel Marcus, Feb 16 2020
Showing 1-8 of 8 results.