login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A073579 Signed primes: if prime(n) even, a(n) = 0; if prime(n) == 1 (mod 4), a(n) = prime(n); if prime(n) == -1 (mod 4), a(n) = -prime(n). 5
0, -3, 5, -7, -11, 13, 17, -19, -23, 29, -31, 37, 41, -43, -47, 53, -59, 61, -67, -71, 73, -79, -83, 89, 97, 101, -103, -107, 109, 113, -127, -131, 137, -139, 149, -151, 157, -163, -167, 173, -179, 181, -191, 193, 197, -199, -211, -223, -227, 229, 233, -239 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Product_{i>1} (1/(1 - 1/a(i))) = 1 - 1/3 + 1/5 - 1/7 - 1/9 + 1/11 ...
= (Pi/4)*Product_{i>1} (1/(1 + 1/a(i)))
= (Pi/2)*Product_{i>1} (1/(1 - 1/a(i)))*Product_{i>1} (1/(1 + 1/a(i)))
= Product_{i>1} (1/(1 - 1/prime(i)^2))
= 1 + 1/3^2 + 1/5^2 + 1/7^2 + 1/9^2 + ...
= Pi^2/8.
Also prime(n)*(2 - prime(n) mod 4) = A000040(n)*A070750(n). - Reinhard Zumkeller, Oct 21 2002
This is a signed version of A160656. - T. D. Noe, Feb 28 2012
LINKS
FORMULA
a(1)=0 and for i>1: a(i) = (-1)^((prime(i)-1)/2)*prime(i).
EXAMPLE
a(1) = 0 because prime(1)=2 is neither 4k+1 nor 4k-1.
a(6) = 13 = prime(6) because 13 = 4*3 + 1.
a(8) = -19 = -prime(8) because 19 = 4*5 - 1.
MAPLE
0, seq(I^(ithprime(n)-1)*ithprime(n), n = 2..100); # G. C. Greubel, Dec 31 2019
MATHEMATICA
Join[{0}, If[Mod[#, 4]==1, #, -#]&/@Prime[Range[2, 60]]] (* Harvey P. Dale, Feb 27 2012 *)
Join[{0}, Table[p = Prime[n]; If[Mod[p, 4] == 1, p, -p], {n, 2, 100}]] (* T. D. Noe, Feb 28 2012 *)
PROG
(Haskell)
a073579 n = p * (2 - p `mod` 4) where p = a000040 n
-- Reinhard Zumkeller, Feb 28 2012
(PARI) forprime(p=2, 239, print1(p*(2-p%4), ", ")) \\ Hugo Pfoertner, Dec 17 2019
(Magma) C<i> := ComplexField(); [0] cat [Round(i^(NthPrime(n)-1)*NthPrime(n)): n in [2..100]]; // G. C. Greubel, Dec 31 2019
(Sage) [0]+[I^(nth_prime(n)-1)*nth_prime(n) for n in (2..100)] # G. C. Greubel, Dec 31 2019
CROSSREFS
Cf. A000040, A160656, A111003 (Pi^2/8).
Sequence in context: A075763 A074918 A175524 * A006005 A065091 A160656
KEYWORD
easy,sign
AUTHOR
Miklos Kristof, Aug 28 2002
EXTENSIONS
Corrected (sign changed on 179) by Harvey P. Dale, Feb 27 2012
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)