cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

2, 3, 8, 15, 12, 21, 32, 36, 40, 55, 72, 65, 56, 90, 64, 119, 144, 57, 120, 168, 132, 161, 240, 200, 156, 270, 168, 203, 360, 155, 320, 396, 136, 350, 432, 333, 380, 546, 320, 369, 672, 387, 352, 810, 368, 423, 672, 294, 600, 816, 520, 583, 864, 660, 784
Offset: 2

Views

Author

Reinhard Zumkeller, Mar 06 2014

Keywords

Comments

Sum of n-th row in triangle A171637.

Crossrefs

Programs

  • Haskell
    a238778 n = sum $ filter ((== 1) . a010051') $
       map (2 * n -) $ takeWhile (<= 2 * n) a000040_list
    
  • Mathematica
    Table[Total@Select[Select[Prime[Range[2 n]], # < 2 n &], PrimeQ[2 n - #] &], {n, 2, 56}] (* Robert Price, Apr 26 2025 *)
  • PARI
    a(n) = my(s=0); forprime(p=2, 2*n, if(isprime(2*n-p), s+=p)); s; \\ Michel Marcus, Jan 24 2022

Formula

a(n) = A008472(A238711(n)).
a(n) mod 2 = A010051(n).
a(n) = n*A035026(n). - Robert G. Wilson v, Apr 28 2018