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.
%I A039701 #70 Dec 12 2024 09:29:10 %S A039701 2,0,2,1,2,1,2,1,2,2,1,1,2,1,2,2,2,1,1,2,1,1,2,2,1,2,1,2,1,2,1,2,2,1, %T A039701 2,1,1,1,2,2,2,1,2,1,2,1,1,1,2,1,2,2,1,2,2,2,2,1,1,2,1,2,1,2,1,2,1,1, %U A039701 2,1,2,2,1,1,1,2,2,1,2,1,2,1,2,1,1,2,2,1,2,1,2,2,1,2,1,2,2,2,1,1,1,2,2,2,1 %N A039701 a(n) = n-th prime modulo 3. %C A039701 If n > 2 and prime(n) is a Mersenne prime then a(n) = 1. Proof: prime(n) = 2^p - 1 for some odd prime p, so prime(n) = 2*4^((p-1)/2) - 1 == 2 - 1 = 1 (mod 3). - _Santi Spadaro_, May 03 2002; corrected and simplified by _Dean Hickerson_, Apr 20 2003 %C A039701 Except for n = 2, a(n) is the smallest number k > 0 such that 3 divides prime(n)^k - 1. - _T. D. Noe_, Apr 17 2003 %C A039701 a(n) <> 0 for n <> 2; a(A049084(A003627(n))) = 2; a(A049084(A002476(n))) = 1; A134323(n) = (1 - 0^a(n)) * (-1)^(a(n)+1). - _Reinhard Zumkeller_, Oct 21 2007 %C A039701 Probability of finding 1 (or 2) in this sequence is 1/2. This follows from the Prime Number Theorem in arithmetic progressions. Examples: There are 4995 1's in terms (10^9 +1) to (10^9+10^4); there are 10^9/2-1926 1's in the first 10^9 terms. - _Jerzy R Borysowicz_, Mar 06 2022 %H A039701 Nathaniel Johnston, <a href="/A039701/b039701.txt">Table of n, a(n) for n = 1..10000</a> %F A039701 Sum_k={1..n} a(k) ~ (3/2)*n. - _Amiram Eldar_, Dec 11 2024 %p A039701 seq(ithprime(n) mod 3, n=1..105); # _Nathaniel Johnston_, Jun 29 2011 %t A039701 Table[Mod[Prime[n], 3], {n, 100}] %o A039701 (Haskell) %o A039701 a039701 = (`mod` 3) . a000040 %o A039701 a039701_list = map (`mod` 3) a000040_list %o A039701 -- _Reinhard Zumkeller_, Nov 16 2012 %o A039701 (Magma) [p mod(3): p in PrimesUpTo(500)]; // _Vincenzo Librandi_, May 06 2014 %o A039701 (PARI) primes(100)%3 \\ _Charles R Greathouse IV_, May 06 2014 %Y A039701 Cf. A091178 (indices of 1's), A091177 (indices of 2's). %Y A039701 Cf. A120326 (partial sums). %Y A039701 Cf. A185934, A217659. %Y A039701 Cf. A010872. %Y A039701 Other moduli: A039702-A039706, A038194, A007652, A039709-A039715. %K A039701 nonn,easy %O A039701 1,1 %A A039701 _Clark Kimberling_