login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A039701 a(n) = n-th prime modulo 3. 27

%I

%S 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 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 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 a(n) = n-th prime modulo 3.

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

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

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

%t Table[Mod[Prime[n], 3], {n, 100}]

%o (Haskell)

%o a039701 = (`mod` 3) . a000040

%o a039701_list = map (`mod` 3) a000040_list

%o -- _Reinhard Zumkeller_, Nov 16 2012

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

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

%Y Cf. A039702-A039706, A038194, A007652, A039709-A039715, A185934, A217659.

%K nonn,easy

%O 1,1

%A _Clark Kimberling_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 31 04:01 EDT 2021. Contains 346367 sequences. (Running on oeis4.)