A039706 a(n) = n-th prime modulo 8.
2, 3, 5, 7, 3, 5, 1, 3, 7, 5, 7, 5, 1, 3, 7, 5, 3, 5, 3, 7, 1, 7, 3, 1, 1, 5, 7, 3, 5, 1, 7, 3, 1, 3, 5, 7, 5, 3, 7, 5, 3, 5, 7, 1, 5, 7, 3, 7, 3, 5, 1, 7, 1, 3, 1, 7, 5, 7, 5, 1, 3, 5, 3, 7, 1, 5, 3, 1, 3, 5, 1, 7, 7, 5, 3, 7, 5, 5, 1, 1, 3, 5, 7, 1, 7, 3, 1, 1, 5, 7, 3, 7, 7, 3, 3, 7, 5, 1, 3, 5, 3, 5, 3, 1, 3
Offset: 1
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[p mod(8): p in PrimesUpTo(500)]; // Vincenzo Librandi, May 06 2014
-
Maple
seq(ithprime(n) mod 8, n=1..105); # Nathaniel Johnston, Jun 29 2011
-
Mathematica
Table[Mod[Prime[n], 8], {n, 105}] (* Nathaniel Johnston, Jun 29 2011 *) Mod[Prime[Range[100]], 8] (* Vincenzo Librandi, May 06 2014 *)
-
PARI
primes(100)%8 \\ Charles R Greathouse IV, May 06 2014
Formula
Sum_k={1..n} a(k) ~ 4*n. - Amiram Eldar, Dec 11 2024