login
Let p = prime(n): if p mod 4 == 1 then a(n) = (1+p)/2 otherwise if p mod 4 == 3 then a(n) = (1-p)/2.
2

%I #60 May 09 2017 08:46:57

%S -1,3,-3,-5,7,9,-9,-11,15,-15,19,21,-21,-23,27,-29,31,-33,-35,37,-39,

%T -41,45,49,51,-51,-53,55,57,-63,-65,69,-69,75,-75,79,-81,-83,87,-89,

%U 91,-95,97,99,-99,-105,-111,-113,115,117,-119,121,-125,129,-131,135,-135,139,141,-141,147,-153,-155,157,159,-165,169,-173,175,177,-179,-183,187,-189,-191,195,199,201,205

%N Let p = prime(n): if p mod 4 == 1 then a(n) = (1+p)/2 otherwise if p mod 4 == 3 then a(n) = (1-p)/2.

%H Dimitris Valianatos, <a href="/A271974/a271974.txt">Comments on this sequence</a>, Apr 25 2016

%F Product_{n>2} (1-1/a(n)) = (1-1/3)*(1-1/(-3))*(1-1/(-5))*(1-1/7)*(1-1/9)*(1-1/(-9))*(1-1/(-11))*(1-1/15)*(1-1/(-15))*... = (2/3)*(4/3)*(6/5)*(6/7)*(8/9)*(10/9)*(12/11)*(14/15)*(16/15)*... = 1.

%F So Product_{n>2} (1-a(n)^(-1)) = Product_{n>2}(1-a(n)^(-1))^(-1) = (Product_{n>2}(1-a(n)^(-1)))^k = 1, for every k.

%F Sum_ {n>2} log(1-1/a(n)) = 0.

%e For n=11, prime(11) = 31, 31 mod 4 == 3 so a(11) = (1-31)/2 = -15.

%t If[Mod[#,4]==1,(1+#)/2,(1-#)/2]&/@Prime[Range[2,80]] (* _Harvey P. Dale_, May 09 2017 *)

%o (PARI) {forstep(n=3,1000,2,if(isprime(n),if(n%4==1,p=(1+n)/2,p=(1-n)/2);print1(n"-> "p", ")));}

%Y Cf. A039702, A272295.

%K sign

%O 2,2

%A _Dimitris Valianatos_, Apr 23 2016

%E Corrected and extended by _Harvey P. Dale_, May 09 2017