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”).

Sum of all primes p such that 2n - p is also a prime.
4

%I #13 Jan 24 2022 10:01:17

%S 2,3,8,15,12,21,32,36,40,55,72,65,56,90,64,119,144,57,120,168,132,161,

%T 240,200,156,270,168,203,360,155,320,396,136,350,432,333,380,546,320,

%U 369,672,387,352,810,368,423,672,294,600,816,520,583,864,660,784

%N Sum of all primes p such that 2n - p is also a prime.

%C Sum of n-th row in triangle A171637.

%H Reinhard Zumkeller, <a href="/A238778/b238778.txt">Table of n, a(n) for n = 2..10000</a>

%F a(n) = A008472(A238711(n)).

%F a(n) mod 2 = A010051(n).

%F a(n) = n*A035026(n). - _Robert G. Wilson v_, Apr 28 2018

%o (Haskell)

%o a238778 n = sum $ filter ((== 1) . a010051') $

%o map (2 * n -) $ takeWhile (<= 2 * n) a000040_list

%o (PARI) a(n) = my(s=0); forprime(p=2, 2*n, if(isprime(2*n-p), s+=p)); s; \\ _Michel Marcus_, Jan 24 2022

%Y Cf. A008472, A238711.

%Y Cf. A010051, A035026, A171637

%K nonn

%O 2,1

%A _Reinhard Zumkeller_, Mar 06 2014