login
A175220
The fifth nonprimes after the primes.
2
10, 10, 12, 14, 18, 20, 24, 25, 28, 35, 36, 44, 48, 49, 52, 58, 65, 66, 74, 77, 78, 85, 88, 94, 104, 108, 110, 114, 115, 118, 133, 136, 143, 144, 155, 156, 162, 169, 172, 178, 185, 186, 198, 200, 203, 204, 216, 230, 234, 235, 238, 245, 246, 256, 262, 268, 275
OFFSET
1,1
COMMENTS
From Robert Israel, Jul 05 2016: (Start)
For n>1, there are the following cases:
If prime(n)+2 and prime(n)+4 are composite, then a(n) = prime(n)+5.
If exactly one of prime(n)+2 and prime(n)+4 is prime, and prime(n)+6 is composite, then a(n) = prime(n) + 6.
Otherwise, a(n) = prime(n) + 7. (End)
LINKS
MAPLE
N:= 1000: # to get all entries <= N
Primes:= select(isprime, [2, seq(i, i=3..N+7, 2)]):
nprimes:= nops(Primes):
A[1]:= 10:
A[2]:= 10:
for i from 3 to nprimes-1 do
p:= Primes[i];
if p + 5 > N then break fi;
if Primes[i+1] > p + 4 then A[i]:= p + 5
elif (i = nprimes-1 or Primes[i+2] <> p+6) and p+6 <= N then A[i]:= p + 6
elif p+7 <= N then A[i]:= p + 7
else break
fi
od:
seq(A[j], j=1..i-1); # Robert Israel, Jul 05 2016
CROSSREFS
Sequence in context: A354049 A354113 A354114 * A272479 A167427 A227437
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Mar 06 2010
STATUS
approved