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”).

a(n) = prime(n) + n*(-1)^n.
1

%I #10 Sep 08 2022 08:45:52

%S 1,5,2,11,6,19,10,27,14,39,20,49,28,57,32,69,42,79,48,91,52,101,60,

%T 113,72,127,76,135,80,143,96,163,104,173,114,187,120,201,128,213,138,

%U 223,148,237,152,245,164,271,178,279,182,291,188,305,202,319,212,329,218

%N a(n) = prime(n) + n*(-1)^n.

%H G. C. Greubel, <a href="/A176624/b176624.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A000040(n) + A038608(n+1).

%e a(1)=1 because prime(1) + 1*(-1)^1 = 1.

%p A176624 := proc(n) ithprime(n)+n*(-1)^n ; end proc: seq(A176624(n),n=1..120) ; # _R. J. Mathar_, Apr 27 2010

%t Table[Prime[n]+(-1)^n*n, {n,60}] (* _G. C. Greubel_, Jul 01 2021 *)

%o (Magma) [NthPrime(n) +(-1)^n*n: n in [1..60]]; // _G. C. Greubel_, Jul 01 2021

%o (Sage) [nth_prime(n) +(-1)^n*n for n in (1..60)] # _G. C. Greubel_, Jul 01 2021

%Y Cf. A000040, A038608, A176628.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Apr 22 2010

%E Entries checked by _R. J. Mathar_, Apr 27 2010