STATUS
reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
a[n_] := Which[!PrimeQ[n], 0, m = Mod[n, 4]; m == 1, 1, m == 3, -1, True, 0]; Array[a, 105] (* Jean-François Alcover, Dec 03 2016 *)
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed
a:= proc(n) if n::odd and isprime(n) then 2 - (n mod 4) else 0 fi end proc:
seq(a(n), n=1..100); # Robert Israel, Aug 22 2014
reviewed
editing
proposed
reviewed
editing
proposed