login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A084360
Number of partitions of n into pair of parts whose difference is a prime.
1
0, 0, 0, 1, 1, 1, 2, 1, 3, 1, 3, 1, 4, 1, 5, 1, 5, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1
OFFSET
1,7
COMMENTS
Order of set A = { (p,q): p+q = n, q>=p and q-p is a prime}.
a(1) = a(2) = 0; for even n >= 4, a(n) = 1; for odd n >= 3, a(n) = pi(n-1) - 1, where pi(n) = A000720(n) is the prime counting function. - Wesley Ivan Hurt, Feb 01 2013
LINKS
FORMULA
a(n) = ( pi(n-1)-2 )*( n mod 2 ) + 1 + floor(1/n) - floor(n/2)*floor(2/n). - Wesley Ivan Hurt, Feb 01 2013
a(n) = Sum_{i=1..floor(n/2)} A010051(n-2i). - Wesley Ivan Hurt, Apr 10 2018
EXAMPLE
a(7) = 2 and the partitions are (1,6) and (2,5).
MATHEMATICA
a[1] = a[2] = 0; a[n_] := If[EvenQ[n], 1, PrimePi[n - 1] - 1]; Array[a, 90] (* Jean-François Alcover, Nov 24 2016, after Wesley Ivan Hurt *)
PROG
(PARI) A084360(n) = if(n<=2, 0, if(!(n%2), 1, primepi(n-1)-1)); \\ Antti Karttunen, Jan 22 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, May 27 2003
EXTENSIONS
More terms from Michel ten Voorde, Jun 20 2003
STATUS
approved