OFFSET
1,1
COMMENTS
The addends need not be distinct, see example.
Probably a(n) ~ 6n and all multiples of 6 greater than 4206 are present. - Charles R Greathouse IV, Nov 06 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
8 is in the sequence since 8 = 4+4 and 4 is the average of the twin primes 3 and 5.
10 is in the sequence since 10 = 4+6 and both 4 and 6 are the average of the twin primes 3,5 and 5,7 respectively.
12 is in the sequence since 12 = 6+6 and 6 is the average of the twin primes 5 and 7.
14 is not in the sequence since it is not the sum of two numbers that are the average of twin primes.
PROG
(PARI) v=[]; for(n=1, 10^3, if(isprime(n-1)&&isprime(n+1), v=concat(v, n)))
b=[]; for(n=1, 1000, for(k=1, n, if(vecsearch(v, k)&&vecsearch(v, n-k), b=concat(b, n)))); vecsort(b, , 8) \\ Derek Orr, Nov 02 2014
(PARI) list(lim)=my(v=List(), p, r); p=3; forprime(q=5, lim-3, if(q-p>2, p=q; next); r=3; forprime(s=5, min(lim-q+2, q), if(s-r==2, listput(v, p+s)); r=s); p=q); Set(v) \\ Charles R Greathouse IV, Nov 06 2014
(PARI) list(lim)=my(v=List(), P=primes([3, lim\1-3]), Q=v, t); for(i=2, #P, if(P[i]-P[i-1]==2, listput(Q, P[i]-1))); P=0; forstep(n=8, lim, 2, for(i=1, #Q, if(setsearch(Q, t=n-Q[i]), listput(v, n); break); if(t<Q[i], break))); Vec(v) \\ Charles R Greathouse IV, Nov 06 2014
(PARI) is(n)=my(p=3); forprime(q=5, n\2+1, if(isprime(n-p)&&isprime(n-p-2), return(1)); p=q); 0 \\ Charles R Greathouse IV, Nov 06 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 02 2014
EXTENSIONS
Missing a(19) added by Charles R Greathouse IV, Nov 06 2014
STATUS
approved