|
|
A039701
|
|
a(n) = n-th prime modulo 3.
|
|
27
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
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
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
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
|
|
LINKS
|
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[Mod[Prime[n], 3], {n, 100}]
|
|
PROG
|
(Haskell)
a039701 = (`mod` 3) . a000040
a039701_list = map (`mod` 3) a000040_list
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|