OFFSET
2,1
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
EXAMPLE
11, the 5th prime, is of the form 4m - 1, so a(5) = 4m + 1 = 13.
MAPLE
a:=proc(n) if ithprime(n) mod 4 = 3 then ithprime(n)+2 else ithprime(n)-2 fi end: seq(a(n), n=2..75); # Emeric Deutsch, Jun 19 2005
MATHEMATICA
Array[Total[QuotientRemainder[Prime@ #, 4] /. {q_, r_} /; OddQ@ r :> If[r == 1, {4 (q - 1), 3}, {4 (q + 1), 1}]] &, 59, 2] (* Michael De Vlieger, Dec 23 2017 *)
Table[Prime[n] + 2(Mod[Prime[n], 4] - 2), {n, 2, 63}] (* Alonso del Arte, Dec 23 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jun 17 2005
EXTENSIONS
More terms from Emeric Deutsch, Jun 19 2005
STATUS
approved