Is the sum of the first $2n+1$ primes ever divisible by 3?

77 Views Asked by At

I can't find a small $n$ that works.

I tried to prove there's no such $n$ using the fact that every prime is congruent to either 1 or 5 (mod 6), but that isn't enough.

1

There are 1 best solutions below

0
On BEST ANSWER

In addition to OEIS lists that Robert has provided, it's not too difficult to write a script to check this (using python, in this case).

As a more general rule: if you think you've identified a modular pattern in the prime numbers that doesn't just follow from basic facts about what most prime numbers must be mod $k$ for different values of $k$, you probably haven't; mathematicians have been looking for patterns like that for a very long time, and they don't appear to exist.

def prime_generator():
 primes = set()
 n = 2
 while True:
  for p in primes:
   if n % p == 0:
    break
  else:
   yield n
   primes.add(n)
  n += 1

def check_sums():
 s = 0
 prime_position = 0
 for p in prime_generator():
  prime_position += 1
  s += p
  print(prime_position, "\t", p)
  if prime_position % 2 == 1:
   if s % 3 == 0:
    print("Sum =", s, "is divisible by 3!")
    input()

check_sums()

which yields the result:

1        2
2        3
3        5
4        7
5        11
6        13
7        17
8        19
9        23
10       29
11       31
12       37
13       41
14       43
15       47
16       53
17       59
18       61
19       67
20       71
21       73
22       79
23       83
24       89
25       97
26       101
27       103
28       107
29       109
30       113
31       127
32       131
33       137
34       139
35       149
36       151
37       157
38       163
39       167
40       173
41       179
42       181
43       191
44       193
45       197
46       199
47       211
48       223
49       227
50       229
51       233
52       239
53       241
54       251
55       257
56       263
57       269
Sum = 6870 is divisible by 3!