login
A039702
a(n) = n-th prime modulo 4.
25
2, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 1, 1, 3, 3, 3, 3, 1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 1, 3, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 1, 3, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 1, 3, 1, 3, 1, 3
OFFSET
1,1
COMMENTS
Except for the first term, A100672(n) = (A039702(n)-1)/2 = parity of A005097. - Jeremy Gardiner, May 17 2008
LINKS
MAPLE
seq(ithprime(n) mod 4, n=1..105); # Nathaniel Johnston, Jun 29 2011
MATHEMATICA
Table[Mod[Prime[n], 4], {n, 105}] (* Nathaniel Johnston, Jun 29 2011 *)
Mod[Prime[Range[100]], 4] (* Vincenzo Librandi, May 06 2014 *)
PROG
(Haskell)
a039702 = (`mod` 4) . a000040 -- Reinhard Zumkeller, Feb 20 2012
(PARI) a(n)=prime(n)%4 \\ Charles R Greathouse IV, Jun 13 2013
(Magma) [p mod 4: p in PrimesUpTo(500)]; // Vincenzo Librandi, May 06 2014
KEYWORD
nonn,easy
STATUS
approved