login
a(n) = n-th prime modulo 5.
16

%I #26 Sep 08 2022 08:44:53

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

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

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

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

%C a(A049084(A045356(n-1))) = even; a(A049084(A045429(n-1))) = odd. - _Reinhard Zumkeller_, Feb 25 2008

%H R. Zumkeller, <a href="/A039703/b039703.txt">Table of n, a(n) for n = 1..1000</a>

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

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

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

%o (PARI) primes(105) % 5 \\ _Zak Seidov_, Apr 09 2013

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

%Y Cf. A000040, A039701, A039702, A039704-A039706, A038194, A007652, A039709-A039715.

%K nonn,easy

%O 1,1

%A _Clark Kimberling_