OFFSET
1,1
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
a(n+1) = p + (-1/p) = p + (-1)^((p-1)/2), where p is the n-th odd prime and (-1/p) denotes the value of Legendre symbol. - Lekraj Beedassy, Mar 17 2005
From Amiram Eldar, Dec 24 2022: (Start)
Product_{n>=1} a(n)/prime(n) = 2/Pi (A060294). (End)
EXAMPLE
a(2) = 2 because the second prime is 3, and 3 + 2 - 3 = 2.
a(3) = 6 because the third prime is 5, and 5 + 2 - 1 = 6.
a(4) = 6 because the fourth prime is 7, and 7 + 2 - 3 = 6.
MATHEMATICA
Table[Prime[n] + 2 - Mod[Prime[n], 4], {n, 60}] (* Alonso del Arte, Feb 23 2015 *)
PROG
(PARI) vector(60, n, 2 + prime(n) - lift(Mod(prime(n), 4))) \\ G. C. Greubel, Nov 14 2018
(Magma) [2 + NthPrime(n) - (NthPrime(n) mod 4): n in [1..60]]; // G. C. Greubel, Nov 14 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, May 02 2003
STATUS
approved