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”).

a(n) = n-th prime modulo 8.
18

%I #16 Dec 12 2024 00:58:04

%S 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,

%T 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,

%U 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

%N a(n) = n-th prime modulo 8.

%H Nathaniel Johnston, <a href="/A039706/b039706.txt">Table of n, a(n) for n = 1..10000</a>

%F Sum_k={1..n} a(k) ~ 4*n. - _Amiram Eldar_, Dec 11 2024

%p seq(ithprime(n) mod 8, n=1..105); # _Nathaniel Johnston_, Jun 29 2011

%t Table[Mod[Prime[n], 8], {n, 105}] (* _Nathaniel Johnston_, Jun 29 2011 *)

%t Mod[Prime[Range[100]], 8] (* _Vincenzo Librandi_, May 06 2014 *)

%o (Magma) [p mod(8): p in PrimesUpTo(500)]; // _Vincenzo Librandi_, May 06 2014

%o (PARI) primes(100)%8 \\ _Charles R Greathouse IV_, May 06 2014

%Y Cf. A039701-A039705, A038194, A007652, A039709-A039715.

%K nonn,easy

%O 1,1

%A _Clark Kimberling_