cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A039702 a(n) = n-th prime modulo 4.

This page as a plain text file.
%I A039702 #35 Dec 12 2024 09:29:13
%S A039702 2,3,1,3,3,1,1,3,3,1,3,1,1,3,3,1,3,1,3,3,1,3,3,1,1,1,3,3,1,1,3,3,1,3,
%T A039702 1,3,1,3,3,1,3,1,3,1,1,3,3,3,3,1,1,3,1,3,1,3,1,3,1,1,3,1,3,3,1,1,3,1,
%U A039702 3,1,1,3,3,1,3,3,1,1,1,1,3,1,3,1,3,3,1,1,1,3,3,3,3,3,3,3,1,1,3,1,3,1,3,1,3
%N A039702 a(n) = n-th prime modulo 4.
%C A039702 Except for the first term, A100672(n) = (a(n)-1)/2 = parity of A005097. - _Jeremy Gardiner_, May 17 2008
%H A039702 Nathaniel Johnston, <a href="/A039702/b039702.txt">Table of n, a(n) for n = 1..10000</a>
%F A039702 Sum_k={1..n} a(k) ~ 2*n. - _Amiram Eldar_, Dec 11 2024
%p A039702 seq(ithprime(n) mod 4, n=1..105); # _Nathaniel Johnston_, Jun 29 2011
%t A039702 Table[Mod[Prime[n], 4], {n, 105}] (* _Nathaniel Johnston_, Jun 29 2011 *)
%t A039702 Mod[Prime[Range[100]], 4] (* _Vincenzo Librandi_, May 06 2014 *)
%o A039702 (Haskell)
%o A039702 a039702 = (`mod` 4) . a000040  -- _Reinhard Zumkeller_, Feb 20 2012
%o A039702 (PARI) a(n)=prime(n)%4 \\ _Charles R Greathouse IV_, Jun 13 2013
%o A039702 (Magma) [p mod 4: p in PrimesUpTo(500)]; // _Vincenzo Librandi_, May 06 2014
%Y A039702 Cf. A000040, A010873.
%Y A039702 Cf. A005097, A100672.
%Y A039702 Cf. A039701, A039703-A039706, A100672, A005097, A038194, A007652, A039709-A039715.
%K A039702 nonn,easy
%O A039702 1,1
%A A039702 _Clark Kimberling_