login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A176624
a(n) = prime(n) + n*(-1)^n.
1
1, 5, 2, 11, 6, 19, 10, 27, 14, 39, 20, 49, 28, 57, 32, 69, 42, 79, 48, 91, 52, 101, 60, 113, 72, 127, 76, 135, 80, 143, 96, 163, 104, 173, 114, 187, 120, 201, 128, 213, 138, 223, 148, 237, 152, 245, 164, 271, 178, 279, 182, 291, 188, 305, 202, 319, 212, 329, 218
OFFSET
1,2
LINKS
FORMULA
a(n) = A000040(n) + A038608(n+1).
EXAMPLE
a(1)=1 because prime(1) + 1*(-1)^1 = 1.
MAPLE
A176624 := proc(n) ithprime(n)+n*(-1)^n ; end proc: seq(A176624(n), n=1..120) ; # R. J. Mathar, Apr 27 2010
MATHEMATICA
Table[Prime[n]+(-1)^n*n, {n, 60}] (* G. C. Greubel, Jul 01 2021 *)
PROG
(Magma) [NthPrime(n) +(-1)^n*n: n in [1..60]]; // G. C. Greubel, Jul 01 2021
(Sage) [nth_prime(n) +(-1)^n*n for n in (1..60)] # G. C. Greubel, Jul 01 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Entries checked by R. J. Mathar, Apr 27 2010
STATUS
approved