login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A039703
a(n) = n-th prime modulo 5.
16
2, 3, 0, 2, 1, 3, 2, 4, 3, 4, 1, 2, 1, 3, 2, 3, 4, 1, 2, 1, 3, 4, 3, 4, 2, 1, 3, 2, 4, 3, 2, 1, 2, 4, 4, 1, 2, 3, 2, 3, 4, 1, 1, 3, 2, 4, 1, 3, 2, 4, 3, 4, 1, 1, 2, 3, 4, 1, 2, 1, 3, 3, 2, 1, 3, 2, 1, 2, 2, 4, 3, 4, 2, 3, 4, 3, 4, 2, 1, 4, 4, 1, 1, 3, 4, 3, 4, 2, 1, 3, 2, 4, 2, 1, 4, 3, 4, 1, 3, 1, 2, 2, 3, 4, 1
OFFSET
1,1
COMMENTS
a(A049084(A045356(n-1))) = even; a(A049084(A045429(n-1))) = odd. - Reinhard Zumkeller, Feb 25 2008
LINKS
FORMULA
Sum_k={1..n} a(k) ~ (5/2)*n. - Amiram Eldar, Dec 11 2024
MAPLE
seq(ithprime(n) mod 5, n=1..105); # Nathaniel Johnston, Jun 29 2011
MATHEMATICA
Table[Mod[Prime[n], 5], {n, 105}] (* Nathaniel Johnston, Jun 29 2011 *)
Mod[Prime[Range[100]], 5] (* Vincenzo Librandi, May 06 2014 *)
PROG
(PARI) primes(105) % 5 \\ Zak Seidov, Apr 09 2013
(Magma) [p mod 5: p in PrimesUpTo(500)]; // Vincenzo Librandi, May 06 2014
KEYWORD
nonn,easy
STATUS
approved