OFFSET
1,2
COMMENTS
A105047(n+2) = a(n+1) - a(n). - Reinhard Zumkeller, Aug 11 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 5 because with the primes {3, 5, 7} one can write 6 = 3+3, 8 = 3+5, 10 = 5+5, 12 = 5+7 and 14 = 7+7, for a total of 5 even numbers.
a(3) = 5 because with the primes {3, 5, 7} one can write 6 = 3+3, 8 = 3+5, 10 = 5+5 & 3+7, 12 = 5+7 and 14 = 7+7, for a total of 5 even numbers.
MAPLE
N:= 1000: # to get first N terms
Primes:= {seq(ithprime(i), i=2..N+1)}:
S:= {}:
for n from 1 to N do
S:= S union map(`+`, Primes[1..n], Primes[n]);
A[n]:= nops(S);
od:
seq(A[n], n=1..N); # Robert Israel, Sep 03 2014
MATHEMATICA
f[n_] := Block[{tp = Table[ Prime[i], {i, 2, n + 1}]}, Length[ Union[ Flatten[ Table[tp[[i]] + tp[[j]], {i, n}, {j, i}]] ]]]; Table[ f[n], {n, 60}] (* Robert G. Wilson v, Feb 05 2005 *)
PROG
(PARI) a(n)=my(P=prime(n+1), s); forstep(k=6, 2*P, 2, forprime(p=max(k-P, 3), min(P, k/2), if(isprime(k-p), s++; break))); s \\ Charles R Greathouse IV, Sep 04 2014
(PARI) list(n)=my(P=prime(n+1), u=vectorsmall(P), v=vector(n), k); forprime(p=3, P, forprime(q=3, p, u[(p+q)/2]=1); v[k++]=sum(i=1, p, u[i])); v \\ Charles R Greathouse IV, Sep 04 2014
(Haskell)
import Data.List (nub)
a102696 n = length $ nub
[p + q | p <- take n a065091_list, q <- takeWhile (<= p) a065091_list]
-- Reinhard Zumkeller, Aug 11 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Gabriel Cunningham (gcasey(AT)mit.edu), Feb 04 2005
EXTENSIONS
More terms from Robert G. Wilson v, Feb 05 2005
STATUS
approved