login
This site is supported by donations to The OEIS Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A082542 a(n) = prime(n) + 2 - (prime(n) mod 4). 3
2, 2, 6, 6, 10, 14, 18, 18, 22, 30, 30, 38, 42, 42, 46, 54, 58, 62, 66, 70, 74, 78, 82, 90, 98, 102, 102, 106, 110, 114, 126, 130, 138, 138, 150, 150, 158, 162, 166, 174, 178, 182, 190, 194, 198, 198, 210, 222, 226, 230, 234, 238, 242, 250, 258, 262, 270, 270, 278 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

For k > 1: a(k+1) = a(k) if and only if prime(k) == 1 modulo 4 and prime(k+1) = prime(k) + 2, see A071695 and A071696.

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = A000040(n) + A070750(n).

a(n+1) = p + (-1/p) = p + (-1)^{(p-1)/2)}, where p is the n-th odd prime and (a/b) denotes the value of Legendre symbol. - Lekraj Beedassy, Mar 17 2005

a(n) = (A000040(n) OR 3) - 1. - Jon Maiga, Nov 14 2018

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

Cf. A000040, A070750.

Cf. A039702, A071695, A071696.

Sequence in context: A168276 A039722 A237363 * A162776 A032302 A032214

Adjacent sequences:  A082539 A082540 A082541 * A082543 A082544 A082545

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller, May 02 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 6 04:14 EST 2019. Contains 329784 sequences. (Running on oeis4.)