OFFSET
2,1
COMMENTS
a(n) is asymptotically equal to prime(n). There are infinitely many a(n) > a(n) and infinitely many a(n+1) < a(n). There are arbitrarily large gaps between a(n) and a(n+1) for sufficiently large n. If Goldbach's conjecture is true, this sequence contains infinitely many primes. Conjecture: for any whole number k, there exists at least one a(n) with exactly k prime factors (for k = 3, for instance, 8*20 + 3 = 163 which is prime and the sequence includes 8*20 + 5 = 3 x 5 x 11).
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
FORMULA
a(n) = 8*quotient(n-th prime, 8) + mod(2 + n-th prime, 8) = 2 + n-th prime unless mod(n-th prime, 8) = 7 then -6 + n-th prime.
EXAMPLE
Prime(1) = 2, which is not of the form 8m+1, 8m+3, 8m+5, nor 8m+7, hence this sequence starts with a(2) = 5 because prime(2) = 8*0 + 3, so 8*0+5 = 5.
Prime(11) = 31 = 8*3 + 7, so a(11) = 8*3 + 1 = 25 = 5^2, which happens not to be a prime.
MATHEMATICA
Table[p = Prime[n]; If[ Mod[p, 8] == 7, p - 6, p + 2], {n, 2, 61}] (* Robert G. Wilson v, Jun 24 2005 *)
Table[If[Mod[n, 8]==7, n-6, n+2], {n, Prime[Range[2, 100]]}](* Harvey P. Dale, Dec 04 2017 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jun 19 2005
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Jun 24 2005
STATUS
approved