login
A108245
If n-th prime is 4m - 1, then a(n) = 4m + 1. If n-th prime is 4m + 1, then a(n) = 4m - 1.
2
5, 3, 9, 13, 11, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, 61, 59, 69, 73, 71, 81, 85, 87, 95, 99, 105, 109, 107, 111, 129, 133, 135, 141, 147, 153, 155, 165, 169, 171, 181, 179, 193, 191, 195, 201, 213, 225, 229, 227, 231, 241, 239, 253, 255, 265, 267, 273, 275, 279
OFFSET
2,1
LINKS
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
Cf. A107323.
Sequence in context: A198134 A082454 A377226 * A228789 A221715 A248660
KEYWORD
nonn
AUTHOR
Leroy Quet, Jun 17 2005
EXTENSIONS
More terms from Emeric Deutsch, Jun 19 2005
STATUS
approved