A219180 Number T(n,k) of partitions of n into k distinct prime parts; triangle T(n,k), n>=0, read by rows.
1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 0, 1, 0, 0, 2, 2, 0, 1, 1, 1, 0, 0, 2, 2, 0, 0, 1, 2, 1, 0, 0, 2, 2, 0, 1, 0, 2, 2, 0, 0, 3, 2, 0, 0, 1, 2, 2, 0, 0, 2, 3, 1
Offset: 0
Examples
T(0,0) = 1: [], the empty partition. T(2,1) = 1: [2]. T(5,1) = 1: [5], T(5,2) = 1: [2,3]. T(16,2) = 2: [5,11], [3,13]. Triangle T(n,k) begins: 1; ; 0, 1; 0, 1; ; 0, 1, 1; ; 0, 1, 1; 0, 0, 1; 0, 0, 1; 0, 0, 1, 1; 0, 1; 0, 0, 1, 1; ...
Links
- Alois P. Heinz, Rows n = 0..1000, flattened
Crossrefs
Programs
-
Maple
b:= proc(n, i) option remember; `if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i-1))[]], 0))) end: T:= proc(n) local l; l:= b(n, numtheory[pi](n)); while nops(l)>0 and l[-1]=0 do l:= subsop(-1=NULL, l) od; l[] end: seq(T(n), n=0..50);
-
Mathematica
nn=20;a=Table[Prime[n],{n,1,nn}];CoefficientList[Series[Product[1+y x^a[[i]],{i,1,nn}],{x,0,nn}],{x,y}]//Grid (* Geoffrey Critzer, Nov 21 2012 *) zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, f[PadRight[x, m, z], PadRight[y, m, z]]]; b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, zip[Plus, b[n, i-1], Join[{0}, If[Prime[i] > n, {}, b[n-Prime[i], i-1]]], 0]]]; T[n_] := Module[{l}, l = b[n, PrimePi[n]]; While[Length[l]>0 && l[[-1]] == 0, l = ReplacePart[l, -1 -> Sequence[]]]; l]; Table[T[n], {n, 0, 50}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
-
PARI
T(n)={ Vec(prod(k=1, n, 1 + isprime(k)*y*x^k + O(x*x^n))) } { my(t=T(20)); for(n=1, #t, print(if(t[n]!=0, Vecrev(t[n]), []))) } \\ Andrew Howroyd, Dec 22 2017
Formula
G.f. of column k: Sum_{0
T(n,k) = [x^n*y^k] Product_{i>=1} (1+x^prime(i)*y).
A061357
Number of 0
0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 4, 1, 3, 4, 3, 3, 5, 4, 3, 5, 3, 3, 6, 2, 5, 6, 2, 5, 6, 4, 5, 7, 4, 4, 8, 4, 4, 9, 4, 4, 7, 3, 6, 8, 5, 5, 8, 6, 7, 10, 6, 5, 12, 3, 5, 10, 3, 7, 9, 5, 5, 8, 7, 7, 11, 5, 5, 12, 4, 8, 11, 4, 8, 10, 5, 5, 13, 9, 6, 11, 7, 6, 14, 6, 8, 13, 5, 8, 11, 6, 9
Offset: 1
Comments
Number of prime pairs (p,q) with p < n < q and q-n = n-p.
The same as the number of ways n can be expressed as the mean of two distinct primes.
Conjecture: for n>=4 a(n)>0. - Benoit Cloitre, Apr 29 2003
Conjectures from Rick L. Shepherd, Jun 24 2003: (Start)
1) For each integer N>=1 there exists a positive integer m(N) such that for n>=m(N) a(n)>a(N). (After the first m(N)-1 terms, a(N) does not reappear). In particular, for N=1 (or 2 or 3), m(N)=4 and a(N)=0, giving Benoit Cloitre's conjecture. (cont.)
(cont.) Conjectures based upon observing a(1),...,a(10000):
m(4)=m(5)=m(6)=m(7)=m(19)=20 for a(4)=a(5)=a(6)=a(7)=a(19)=1,
m(8)=...(7 others)...=m(34)=35 for a(8)=...(7 others)...=a(34)=2,
m(12)=...(10 others)...=m(64)=65 for a(12)=...(10 others)...=a(64)=3,
m(18)=...(10 others)...=m(79)=80 for a(18)=...(10 others)...=a(79)=4,
m(24)=...(14 others)...=m(94)=95 for a(24)=...(14 others)...=a(94)=5,
m(30)=...(17 others)...=m(199)=200 for a(30)=...(17 others)...=a(199)=6, etc.
2) Each nonnegative integer appears at least once in the current sequence.
3) Stronger than 2): A001477 (nonnegative integers) is a subsequence of the current sequence. (Supporting evidence: I've observed that 0,1,2,...,175 is a subsequence of a(1),...,a(10000)).
(End)
a(n) is also the number of k such that 2*k+1=p and 2*(n-k-1)+1=q are both odd primes with p < q with p*q = n^2 - m^2. [Pierre CAMI, Sep 01 2008]
Also: Number of ways n^2 can be written as b^2+pq where 0
a(n) = sum (A010051(2*n - p): p prime < n). [Reinhard Zumkeller, Oct 19 2011]
a(n) is also the number of partitions of 2*n into two distinct primes. See the first formula by T. D. Noe, and the Alois P. Heinz, Nov 14 2012, crossreference. - Wolfdieter Lang, May 13 2016
All 0Jamie Morken, Jun 02 2017
a(n) is the number of appearances of n in A143836. - Ya-Ping Lu, Mar 05 2023
Examples
a(10)= 2: there are two such pairs (3,17) and (7,13), as 10 = (3+17)/2 = (7+13)/2.
Links
- Pierre CAMI, Table of n, a(n) for n = 1..60000
Crossrefs
Cf. A071681 (subsequence for prime n only).
Cf. A092953.
Bisection of A117929 (even part). - Alois P. Heinz, Nov 14 2012
Programs
-
Haskell
a061357 n = sum $ zipWith (\u v -> a010051 u * a010051 v) [n+1..] $ reverse [1..n-1] -- Reinhard Zumkeller, Nov 10 2012, Oct 19 2011
-
Mathematica
Table[Count[Range[n - 1], k_ /; And[PrimeQ[n - k], PrimeQ[n + k]]], {n, 98}] (* Michael De Vlieger, May 14 2016 *)
-
PARI
a(n)=my(s);forprime(p=2,n-1,s+=isprime(2*n-p));s \\ Charles R Greathouse IV, Mar 08 2013
-
Python
from sympy import primerange, isprime def A061357(n): return sum(1 for p in primerange(n) if isprime((n<<1)-p)) # Chai Wah Wu, Sep 03 2024
Formula
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
A077914 Sums of two distinct primes in exactly two ways.
16, 18, 20, 22, 26, 28, 32, 62, 68
Offset: 1
Comments
Numbers k such that A117929(k) = 2. - Joerg Arndt, Jun 07 2021
Examples
22 is a term as 22 = 19+3 = 17+5 are the only two ways to express 22 as a sum of two distinct primes.
Links
- G. L. Honaker, Jr., Prime Curio for 16, April 2000.
A166081 Natural numbers that are not the sum of two distinct primes.
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
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
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from G. C. Greubel)
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
A341973 Number of partitions of n into 2 distinct primes (counting 1 as a prime).
1, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 2, 1, 2, 0, 3, 1, 3, 1, 2, 0, 4, 1, 2, 0, 2, 0, 4, 1, 3, 1, 3, 0, 4, 0, 2, 1, 3, 0, 5, 1, 4, 1, 3, 0, 6, 1, 4, 0, 3, 0, 6, 1, 3, 0, 3, 0, 7, 1, 3, 1, 5, 0, 6, 0, 3, 1, 5, 0, 7, 1, 5, 1, 5, 0, 7, 0, 5, 1, 4, 0, 9, 1, 4, 0, 4, 0, 10, 1, 4, 0, 4, 0, 7
Offset: 3
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 3..10000
Programs
-
Maple
b:= proc(n, i) option remember; series(`if`(n=0, 1, `if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i-1)))( `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 3) end: a:= n-> coeff(b(n, numtheory[pi](n)), x, 2): seq(a(n), n=3..96); # Alois P. Heinz, Feb 24 2021
-
Mathematica
a[n_] := Select[IntegerPartitions[n, {2}, Join[{1}, Prime[Range[PrimePi[n-1]]]]], #[[1]] != #[[2]]&] // Length; a /@ Range[3, 100] (* Jean-François Alcover, Jul 13 2021 *)
Formula
A080862 Numbers which can be expressed as the sum of two distinct primes in exactly six ways.
60, 66, 72, 100, 110, 116, 172, 178, 182, 194, 206, 212, 218, 226, 248, 278, 326, 332, 398
Offset: 1
Keywords
Comments
Apparently there are no further terms beyond 398. - R. J. Mathar, Oct 01 2021
Examples
66 is a term as 66 = 37 + 29 = 43 + 23 = 47 + 17 = 53 + 13 = 59 + 7 = 61 + 5 are only the six ways to express 66 as a sum of two distinct primes.
Programs
-
Mathematica
tdpQ[n_]:=Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&&Length[Union[#]]==2&)]==6; Select[Range[400],tdpQ] (* _Harvey P. Dale, Aug 17 2025 *)
Formula
{j: A117929(j) = 6}. - R. J. Mathar, Oct 01 2021
A080854 Numbers which can be expressed as the sum of two distinct primes in exactly five ways.
48, 54, 64, 70, 76, 104, 106, 118, 124, 134, 136, 146, 148, 164, 166, 188
Offset: 1
Keywords
Comments
Apparently there are no further terms beyond 188. - R. J. Mathar, Oct 01 2021
Examples
54 is a term as 54 = 31 + 23 = 37 + 17 = 41 + 13 = 43 + 11 = 47 + 7 are only the five ways to express 54 as a sum of two distinct primes.
Programs
-
Mathematica
Select[Range[200],Count[IntegerPartitions[#,{2}],?(AllTrue[#,PrimeQ]&&#[[1]]!=#[[2]]&)]==5&] (* _Harvey P. Dale, Jul 14 2025 *)
Formula
{j: A117929(j) = 5} . - R. J. Mathar, Oct 01 2021
A087747 Least number expressible as a sum of two distinct primes in exactly n ways.
5, 16, 24, 36, 48, 60, 78, 84, 90, 114, 144, 120, 168, 180, 234, 246, 288, 240, 210, 324, 300, 360, 474, 330, 528, 576, 390, 462, 480, 420, 570, 510, 672, 792, 756, 876, 714, 798, 690, 1038, 630, 1008, 930, 780, 960, 870, 924, 900, 1134, 1434, 840, 990, 1302, 1080, 1230, 1518
Offset: 1
Keywords
Examples
a(2)=16 because we have 16=3+13=5+11, followed by 18=5+13=7+11; 20=3+17=7+13; 22=3+19=5+17; 26=3+23=7+19;...
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A117929.
Programs
-
Mathematica
Module[{nn=2000,ip},ip=Table[{n,Length[Select[IntegerPartitions[n,{2}], #[[1]]!=#[[2]]&&AllTrue[#,PrimeQ]&]]},{n,nn}];Table[SelectFirst[ip, #[[2]]==k&],{k,60}]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 11 2020 *)
Formula
a(n) = min({m >= 1 : A117929(m) = n}). - Peter Munn, May 01 2023
Extensions
More terms from John Dethridge (jcd(AT)ms.unimelb.edu.au), Jan 08 2004
More terms from Hugo Pfoertner, Sep 23 2004
Reinserted a(18), a(19) and a(20) by Paolo P. Lava, May 26 2014
A243485 Sum of all the products formed by multiplying the corresponding smaller and larger parts of the Goldbach partitions of n.
0, 0, 0, 4, 6, 9, 10, 15, 14, 46, 0, 35, 22, 82, 26, 94, 0, 142, 34, 142, 38, 263, 0, 357, 46, 371, 0, 302, 0, 591, 58, 334, 62, 780, 0, 980, 0, 578, 74, 821, 0, 1340, 82, 785, 86, 1356, 0, 1987, 94, 1512, 0, 1353, 0, 2677, 106, 1421, 0, 2320, 0, 4242, 118
Offset: 1
Comments
a(n) is even for odd n.
If Goldbach's conjecture is true, a(n) > 0 for all even n > 2.
Sum of the areas of the distinct rectangles with prime length and width such that L + W = n, W <= L. For example, a(16) = 94; the two rectangles are 3 X 13 and 5 X 11, and the sum of their areas is 3*13 + 5*11 = 94. - Wesley Ivan Hurt, Oct 28 2017
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Eric Weisstein's World of Mathematics, Goldbach Partition
- Wikipedia, Goldbach's conjecture
- Index entries for sequences related to Goldbach conjecture
- Index entries for sequences related to partitions
Programs
-
Maple
with(numtheory): A243485:=n->add(i*(n-i)*(pi(i)-pi(i-1))*(pi(n-i)-pi(n-i-1)), i=1..floor(n/2)): seq(A243485(n), n=1..100); # Wesley Ivan Hurt, Oct 29 2017
-
Mathematica
Table[Sum[i*(n - i)*Floor[2/PrimeOmega[i (n - i)]], {i, 2, n/2}], {n, 50}]
Formula
a(n) = Sum_{i=2..n/2} i*(n-i) * A064911(i*(n-i)).
A347550 Number of partitions of n into at most 2 distinct prime parts.
1, 0, 1, 1, 0, 2, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 3, 1, 2, 0, 2, 1, 3, 2, 2, 1, 3, 0, 4, 1, 1, 1, 3, 1, 4, 2, 3, 1, 3, 1, 5, 1, 4, 0, 3, 1, 5, 1, 3, 0, 3, 1, 6, 2, 2, 1, 5, 0, 6, 1, 2, 1, 5, 1, 6, 2, 4, 1, 5, 0, 7, 1, 4, 1, 4, 1, 8, 1, 4
Offset: 0
Keywords
Formula
a(n) = Sum_{k=0..2} A219180(n,k). - Alois P. Heinz, Sep 08 2021
Comments