login
Number of prime pairs (p,q), p <= q, such that (p+q)/2 = 2*n.
7

%I #45 Mar 09 2018 17:00:44

%S 1,1,1,2,2,3,2,2,4,3,3,5,3,3,6,5,2,6,5,4,8,4,4,7,6,5,8,7,6,12,5,3,9,5,

%T 7,11,5,4,11,8,5,13,6,7,14,8,5,11,9,8,14,7,6,13,9,7,12,7,9,18,9,6,16,

%U 8,10,16,9,7,16,14,8,17,8,8,21,10,8,17,10,11

%N Number of prime pairs (p,q), p <= q, such that (p+q)/2 = 2*n.

%C The Goldbach conjecture, if true, would imply a(n) > 0.

%C Row lengths of table A260689, n > 1. - _Reinhard Zumkeller_, Nov 17 2015

%H Klaus Brockhaus, <a href="/A069360/b069360.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>

%F For n > 1: a(n) = #{k | 2*n-k and 2*n+k are prime, 1<=k<=2*n}.

%F a(n) = Sum_{i=3..2n} isprime(i) * isprime(4n-i) * (sign(4n-i) mod 4), n > 1. - _Wesley Ivan Hurt_, Dec 18 2016

%e n=8: there are 16 pairs (i,j) with (i+j)/2=n*2=16; only two of them, (3,29) and (13,19), consist of primes, therefore a(8)=2.

%t Table[Length[Select[Range[0, 2*n], PrimeQ[2n-#] && PrimeQ[2n+#] &]], {n, 50}] (* _Stefan Steinerberger_, Nov 30 2007 *)

%t Table[Boole[n == 1] + Sum[Boole[PrimeQ@ i] Boole[PrimeQ[4 n - i]] Mod[Sign[4 n - i], 4], {i, 3, 2 n}], {n, 80}] (* _Michael De Vlieger_, Dec 21 2016 *)

%t Table[Count[IntegerPartitions[4n,{2}],_?(AllTrue[#,PrimeQ]&)],{n,80}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 09 2018 *)

%o (Haskell)

%o a069360 n = sum [a010051' (4*n-p) | p <- takeWhile (<= 2*n) a000040_list]

%o -- _Reinhard Zumkeller_, May 08 2014, Apr 09 2012

%o (PARI) a(n)=my(s);forprime(p=2,2*n,s+=isprime(4*n-p));s \\ _Charles R Greathouse IV_, Apr 09 2012

%Y Bisection of A002375.

%Y Cf. A082467 (least k such that n-k and n+k are both primes), A134677 (records), A134678 (where records occur), A135146 (index of first occurrence of n).

%Y Cf. A000040, A010051, A260689.

%K nonn,easy,nice

%O 1,4

%A _Reinhard Zumkeller_, Apr 15 2002

%E Edited by _Klaus Brockhaus_, Nov 20 2007

%E a(1)=1, thanks to _Charles R Greathouse IV_, who noticed this; b-file adjusted.