OFFSET
1,1
COMMENTS
This sequence rules out an exception for A118371, in which a larger even number 2n+2 can insert a prime number p that is smaller than the existing largest prime p_max in the generated sequence from even numbers from 4 to 2n. Such insertion may make some primes greater than p no longer needed when reexamining even numbers greater than p+3, and alters the terms beyond.
In this sequence, a mechanism is proposed to remove all primes greater than p before the insertion of p from the partially generated sequence and reexamine even numbers from p+3.
The result sequence contains a little less prime numbers for many cases than A118371. For example, when checked maximum even number reaches 2 million, this sequence contains 4412 primes while A118371 contains 4422 primes. But this is not necessarily true for all even numbers. For example, for even number 10000, this sequence gives 229 primes while A118371 gives only 226 primes.
The difference of this sequence with A118371 starts from the 33rd term. A118371(33) is 337, while it is 373 in this sequence. Then 373 does not appear in A118371. Then 401, 449, 491, 509 are replaced with 467 and 503.
For the Mathematica program, if just doing sequential generation, the last few terms may not be correct, because when further search finds a smaller necessary prime, it will render the primes larger than that prime invalid. So the program overshoots 1/3 and then takes the first 75% as the result.
EXAMPLE
4 = 2 + 2, and 6 = 3 + 3. So, 2 and 3 are the natural starting of this sequence.
When n = 8, 8 - 2 = 6 is not prime, 8 - 3 = 5 is a prime that is not in set {2, 3}, thus 5 becomes a member of the sequence, making a(3) = 5.
When n = 10, it is found 10 = 5 + 5 and 5 is already in set {2, 3, 5}, so no new addition to the sequence.
When n = 12, 12 - 3 = 9 is not prime, 12 - 5 = 7 is a prime that is not in set {2, 3, 5}, thus 7 becomes a member of the sequence, making a(4) = 7.
Here according to the definition, {a(1) .. a(4)} = { 2, 3, 5, 7 }, 4 = a(1) + a(1), 6 = a(2) + a(2), 8 = a(2) + a(3), 10 = a(3) + a(3). 2e = 7 + (2*3 - 1) = 12, k = 3, 12 is the smallest even number that cannot be written in the sum of two terms in set { 2, 3, 5 }.
When n = 14, 14 = 7 + 7. No new addition.
When n = 16, 16 - 3 = 13, 16 - 5 = 11, 16 - 7 = 9. Amount them 13 and 11 are primes. The bigger one is entered the sequence, making a(5) = 13.
When n = 340, following the same rule, 340 - 3 = 337 is entered the sequence, making it {2, 3, 5, 7, 13, 19, 23, 31, 37, 43, 47, 53, 61, 79, 83, 101, 107, 109, 113, 131, 139, 157, 167, 199, 211, 251, 269, 281, 283, 307, 313, 337}. However, when it goes up to n = 346, the largest prime that is not already in the sequence is 293, from 346 - 53 = 293. When 293 is entered, it invalidates 307, 313, and 337, and reset the checkpoint to n = 296. From this point up, when n = 340 again, 340 - 47 = 293, meaning no new addition, thus 337 is no longer needed.
When n = 380, 380 - 7 = 373 becomes a new term.
MATHEMATICA
ps = {2, 3}; n = 4; While[n = n + 2; n <= 1504, l = Length[ps]; pn = Select[n - ps, PrimeQ]; ct = Length[Intersection[ps, pn]]; If[ct == 0, p = Max[pn]; ps = DeleteCases[ps, x_ /; x > p]; AppendTo[ps, p]; n = ps[[Length[ps]]] + 1]]; ps = ps[[1 ;; Floor[Length[ps]*0.75]]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Apr 09 2026
STATUS
approved
