login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A039704
a(n) = n-th prime modulo 6.
13
2, 3, 5, 1, 5, 1, 5, 1, 5, 5, 1, 1, 5, 1, 5, 5, 5, 1, 1, 5, 1, 1, 5, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 1, 5, 1, 1, 1, 5, 5, 5, 1, 5, 1, 5, 1, 1, 1, 5, 1, 5, 5, 1, 5, 5, 5, 5, 1, 1, 5, 1, 5, 1, 5, 1, 5, 1, 1, 5, 1, 5, 5, 1, 1, 1, 5, 5, 1, 5, 1, 5, 1, 5, 1, 1, 5, 5, 1, 5, 1, 5, 5, 1, 5, 1, 5, 5, 5, 1, 1, 1, 5, 5, 5, 1
OFFSET
1,1
LINKS
FORMULA
Sum_k={1..n} a(k) ~ 3*n. - Amiram Eldar, Dec 11 2024
MAPLE
seq(ithprime(n) mod 6, n=1..105); # Nathaniel Johnston, Jun 29 2011
MATHEMATICA
Table[Mod[Prime[n], 6], {n, 105}] (* Nathaniel Johnston, Jun 29 2011 *)
Mod[Prime[Range[100]], 6] (* Vincenzo Librandi, May 06 2014 *)
PROG
(PARI) primes(105)%6 \\ Zak Seidov, Mar 25 2012
(Magma) [p mod 6: p in PrimesUpTo(500)]; // Vincenzo Librandi, May 06 2014
KEYWORD
nonn,easy,changed
STATUS
approved