A340041 The prime gap, divided by two, which surrounds p#.
1, 1, 6, 1, 9, 24, 23, 40, 51, 37, 60, 36, 68, 87, 66, 84, 99, 95, 115, 88, 117, 143, 51, 177, 182, 168, 139, 243, 221, 193, 204, 516, 260, 154, 182, 306, 239, 216, 191, 211, 303, 263, 672, 303, 615, 417, 312, 378, 275, 375, 322, 445, 312, 294, 354, 492, 399, 348, 461
Offset: 2
Keywords
Examples
For a(1), there are two contiguous primes {2, 3} with 2 being 2#. The prime gap is 1. However, the two primes do not surround 2#, so a(1) like A340013(2) is undefined. For a(2), the prime gap contains {5, 6, 7}, with 3# = 6 in the middle. The prime gap is 2, therefore a(2) = 1; For a(3), the prime gap contains {29, 30, 31}, with 5# = 30 in the middle. The prime gap is 2, therefore a(3) = 1. For a(4), the prime gap contains {199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211}, with 7# = 205 in the middle. The prime gap is 12, therefore a(4) = 6. etc.
Programs
-
Mathematica
a[n_] := Block[{p = Times @@ Prime@ Range@ n}, (NextPrime[p, 1] - NextPrime[p, -1])/2]; a[1] = 0; Array[a, 60]
Comments