0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 4, 1, 3, 4, 3, 3, 5, 4, 3, 5, 3, 3, 6, 2, 5, 6, 2, 5, 6, 4, 5, 7, 4, 4, 8, 4, 4, 9, 4, 4, 7, 3, 6, 8, 5, 5, 8, 6, 7, 10, 6, 5, 12, 3, 5, 10, 3, 7, 9, 5, 5, 8, 7, 7, 11, 5, 5, 12, 4, 8, 11, 4, 8, 10, 5, 5, 13, 9, 6, 11, 7, 6, 14, 6, 8, 13, 5, 8, 11, 6, 9
Offset: 1
A030173
Differences p(i)-p(j) between primes, sorted in numerical order.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 59, 60, 62, 64, 65, 66, 68, 69, 70, 71, 72, 74, 76, 77, 78, 80, 81, 82, 84, 86, 87, 88, 90
Offset: 1
Alexander Grasser [Graesser] (alex(AT)computicket.com)
-
import Data.List.Ordered (union)
a030173 n = a030173_list !! (n-1)
a030173_list = union [2, 4 ..] $ tail a040976_list
-- Reinhard Zumkeller, Jul 03 2015
-
nn = 90; Union[Range[2, nn, 2], Prime[Range[2, PrimePi[nn+2]]] - 2]
-
print1(1);p=3;forprime(q=5,1e3,forstep(n=p-1,q-3,2,print1(", "n));print1(", ",q-2);p=q) \\ conjectural; Charles R Greathouse IV, Jul 02 2011
-
isOK(n)=if(n%2,isprime(n+2),forprime(p=3,,isprime(n+p)&&return(1)));
for(n=1,10^100,isOK(n)&print1(n,", ")) \\ unconditionally outputs correct values only, will "hang" forever if conjecture is false once that exceptional even number is reached; Jeppe Stig Nielsen, Sep 23 2015
A202472
Goldbach's Problem extended to subtraction: number of decompositions of 2n into unordered differences of two primes, p, q, where p < 2n < q.
Original entry on oeis.org
0, 1, 1, 2, 2, 3, 2, 3, 3, 3, 2, 6, 4, 3, 6, 3, 4, 6, 4, 5, 8, 4, 4, 7, 6, 4, 9, 8, 4, 11, 5, 5, 11, 6, 8, 9, 4, 7, 11, 7, 4, 13, 7, 5, 15, 7, 8, 13, 8, 9, 11, 7, 7, 13, 10, 5, 13, 7, 7, 19, 9, 8, 17, 9, 10, 16, 9, 9, 15, 12, 7, 19, 9, 7, 19, 9, 12, 17, 8, 14
Offset: 1
-
Table[Length[Select[Prime[Range[PrimePi[2*n]]], PrimeQ[2*n + #] &]], {n, 100}] (* T. D. Noe, Apr 16 2013 *)
-
a(n)=my(s);forprime(p=2,2*n,s+=isprime(2*n+p));s \\ Charles R Greathouse IV, Dec 19 2011
(C++)
#include
using namespace std;
int main()
{ int p[25] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int count, istart = 2;
for(int n=1; n<=25; n++)
{
if(2*n>p[istart]) istart++;
count = 0;
for(int j=1; p[j]<2*n; j++)
for(int i=istart; p[i]-p[j]<=2*n; i++)
if(p[i]-p[j]==2*n) count++;
cout << n << ". " << count << endl;
}
return 0;
} // code for the first 25 integers, James D. Klein, Dec 21 2011
Comments