A035026 Number of times that i and 2n-i are both prime, for i = 1, ..., 2n-1.
0, 1, 1, 2, 3, 2, 3, 4, 4, 4, 5, 6, 5, 4, 6, 4, 7, 8, 3, 6, 8, 6, 7, 10, 8, 6, 10, 6, 7, 12, 5, 10, 12, 4, 10, 12, 9, 10, 14, 8, 9, 16, 9, 8, 18, 8, 9, 14, 6, 12, 16, 10, 11, 16, 12, 14, 20, 12, 11, 24, 7, 10, 20, 6, 14, 18, 11, 10, 16, 14, 15, 22, 11, 10, 24, 8, 16, 22, 9, 16, 20, 10
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Colored scatterplot of the first 500000 terms
- Index entries for sequences related to Goldbach conjecture
Programs
-
Haskell
a035026 n = sum $ map (a010051 . (2 * n -)) $ takeWhile (< 2 * n) a000040_list -- Reinhard Zumkeller, Oct 19 2011
-
Maple
A035026 := proc(n) local a,i ; a := 0 ; for i from 1 to 2*n-1 do if isprime(i) and isprime(2*n-i) then a := a+1 ; end if; end do: a ; end proc: # R. J. Mathar, Jul 01 2013
-
Mathematica
For[lst={}; n=1, n<=100, n++, For[cnt=0; i=1, i<=2n-1, i++ If[PrimeQ[i]&&PrimeQ[2n-i], cnt++ ]]; AppendTo[lst, cnt]]; lst f[n_] := Block[{c = Boole@ PrimeQ[ n/2], p = 2}, While[ 2p < n, If[ PrimeQ[n - p], c += 2]; p = NextPrime@ p]; c];; Array[ f[ 2#] &, 90] (* Robert G. Wilson v, Dec 15 2016 *)
Formula
a(n) = A073610(2*n). - Ridouane Oudra, Sep 06 2023
Extensions
Corrected by T. D. Noe, May 05 2002
Comments