A065022 Composite n such that the sums of the composite numbers up to n, +/- 1, are twin primes.
4, 8, 290, 340, 352, 412, 489, 610, 774, 785, 1227, 1295, 1306, 1795, 1853, 1918, 1945, 2014, 2266, 2502, 2885, 3063, 3133, 3178, 3265, 3482, 3486, 3680, 3760, 3843, 3973, 3995, 4124, 4794, 5677, 5769, 5965, 6123, 7555, 7653, 7696, 7765, 7786, 8023
Offset: 1
Keywords
Examples
4+6+8 = 18 and 18 +/-1 are twin primes.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
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} ]
-
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
Extensions
New name from Charles R Greathouse IV, Jan 02 2014