OFFSET
1,4
COMMENTS
The Goldbach conjecture, if true, would imply a(n) > 0.
Row lengths of table A260689, n > 1. - Reinhard Zumkeller, Nov 17 2015
LINKS
FORMULA
For n > 1: a(n) = #{k | 2*n-k and 2*n+k are prime, 1<=k<=2*n}.
a(n) = Sum_{i=3..2n} isprime(i) * isprime(4n-i) * (sign(4n-i) mod 4), n > 1. - Wesley Ivan Hurt, Dec 18 2016
EXAMPLE
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.
MATHEMATICA
Table[Length[Select[Range[0, 2*n], PrimeQ[2n-#] && PrimeQ[2n+#] &]], {n, 50}] (* Stefan Steinerberger, Nov 30 2007 *)
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 *)
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 *)
PROG
(Haskell)
a069360 n = sum [a010051' (4*n-p) | p <- takeWhile (<= 2*n) a000040_list]
-- Reinhard Zumkeller, May 08 2014, Apr 09 2012
(PARI) a(n)=my(s); forprime(p=2, 2*n, s+=isprime(4*n-p)); s \\ Charles R Greathouse IV, Apr 09 2012
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Reinhard Zumkeller, Apr 15 2002
EXTENSIONS
Edited by Klaus Brockhaus, Nov 20 2007
a(1)=1, thanks to Charles R Greathouse IV, who noticed this; b-file adjusted.
STATUS
approved