OFFSET
1,1
COMMENTS
Tested up to n = 1000000000, a(n)> 0.
If any zero terms exist, it is likely that the first one will appear in the interval [2*10^9, 2*10^10].
The terms of this sequence form a bell-shaped distribution with the commonest value of 21 when n is large enough. Up to the first 100 million terms, the range of a(n) is [3..55].
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
EXAMPLE
When n=1, 2n=2, b=2, the set of numbers of the form 2^b + 2n + 2^k + 1 is {9, 11}; form 2^b + 2n + 2^k - 1: {7, 9}; form 2^b + 2n - 2^k - 1: {1, 3}; form 2^b + 2n - 2^k + 1: {3, 5}; form 2^(b+2) - 2^b - 2n - 2^k - 1: {7, 5}; form 2^(b+2) - 2^b - 2n - 2^k + 1: {9, 7}; form 2^(b+2) - 2^b - 2n + 2^k + 1: {15, 13}; form 2^(b+2) - 2^b - 2n + 2^k - 1: {13, 11}. The union of the above sets is {1, 3, 5, 7, 9, 11, 13, 15}. Among the 8 numbers, 5 are primes. So a(1)=5.
When n=11, using the same rule, the candidate number set is {21, 23, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 105, 107}. Among these 32 numbers, 15 are prime: {23, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 107}. So a(11)=15.
MATHEMATICA
Table[n2 = 2*n; b = Ceiling[Log[2, n2 + 1]]; sdm = 2^b + n2 - 1;
sdp = 2^b + n2 + 1; cset = {}; Do[cpmp = sdm + 2^k; cpmm = sdm - 2^k; cppp = sdp + 2^k; cppm = sdp - 2^k; upl = 2^(b + 2); cset = Join[
cset, {cpmp, upl - cpmp, cpmm, upl - cpmm, cppp, upl - cppp, cppm,
upl - cppm}], {k, 1, b}]; cset = Union[cset];
size = Length[cset]; ct = 0;
Do[If[PrimeQ[cset[[j]]], ct++], {j, 1, size}]; ct, {n, 1, 66}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Nov 20 2013
EXTENSIONS
Edited by Jon E. Schoenfield, Mar 28 2015
STATUS
approved