OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
4+6+8 = 18 and 18 +/-1 are twin primes.
MATHEMATICA
Composite[n_Integer] := (k = n + PrimePi[n] + 1; While[k - PrimePi[k] - 1 != n, k++ ]; k); s = 0; Do[m = Composite[n]; s = s + m; If[ PrimeQ[s - 1] && PrimeQ[s + 1], Print[m]], {n, 1, 10^4} ]
PROG
(PARI) is(n)=my(s); if(isprime(n), return(0)); forcomposite(k=4, n, s+=k); isprime(s-1)&&isprime(s+1) \\ Charles R Greathouse IV, Jan 02 2014
(PARI) s=0; forcomposite(n=4, 8023, s+=n; if(isprime(s-1) && isprime(s+1), print1(n", "))) \\ Charles R Greathouse IV, Jan 02 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Nov 01 2001
EXTENSIONS
New name from Charles R Greathouse IV, Jan 02 2014
STATUS
approved