Problems & Puzzles: Puzzles

 Puzzle 929. Six primes such that the sum of any five is a prime  number The set of six non-consecutive primes {5, 7, 11, 19, 29, 37} has the interesting property that the the sum of any five of these is a prime number. Q1: Find a set of six consecutive primes with the same property than the set above? Q2: Redo Q1 using 8, 10, ... consecutive primes with the corresponding property similar to the set above?

Contributions came from Seiji Tomita, Giovanni Resta, Paul Cleary, Simon Cavegn and Emmanuel Vantieghem.

***

Seiji wrote on Oct 28, 2018

Q1:
Search condition: {a,b,c,d,e,f}<10^10
Min: {9733, 9739, 9743, 9749, 9767, 9769}
Max: {996712309, 996712331, 996712333, 996712349, 996712361, 996712369}

Q2:
Eight consecutive primes such that the sum of any seven is a prime number.
Min:{69398759, 69398761, 69398779, 69398789, 69398803, 69398807, 69398821, 69398831}

***

Giovanni wrote on Oct 29, 2018:

The starts of 6, 8, 10. and 12 consecutive primes such that the sum of all
apart one gives a prime are 9733, 69398759, 422701985389 and 28999134198739.

***

On October 31, 2018 Paul Cleary wrote:

I have found the following for 6 consecutive primes. Format {consecutive primes}, {sum of any 5 primes}.

{9733,9739,9743,9749,9767,9769} , {48731,48733,48751,48757,48761,48767}

{970217,970219,970231,970237,970247,970259} , {4851151,4851163,4851173,4851179,4851191,4851193}

{3218471,3218473,3218477,3218483,3218503,3218533} , {16092407,16092437,16092457,16092463,16092467,16092469}

{5241937,5241959,5241961,5241983,5241989,5242021} , {26209829,26209861,26209867,26209889,26209891,26209913}

{5691893,5691899,5691913,5691919,5691929,5691943} , {28459553,28459567,28459577,28459583,28459597,28459603}

{8445251,8445259,8445271,8445343,8445377,8445419} , {42226501,42226543,42226577,42226649,42226661,42226669}

{8788079,8788081,8788121,8788141,8788147,8788151} , {43940569,43940573,43940579,43940599,43940639,43940641}

{11268497,11268503,11268511,11268527,11268541,11268571} , {56342579,56342609,56342623,56342639,56342647,56342653}

{11881901,11881913,11881927,11881931,11881957,11882071} , {59409629,59409743,59409769,59409773,59409787,59409799}

And 8 consecutive primes

{69398759,69398761,69398779,69398789,69398803,69398807,69398821,69398831} , {485791519,485791529,485791543,485791547,485791561,485791571,485791589,485791591}

{120009433,120009541,120009551,120009553,120009563,120009619,120009629,120009641} , {840066889,840066901,840066911,840066967,840066977,840066979,840066989,840067097}

{130095619,130095701,130095731,130095733,130095739,130095803,130095877,130095887} , {910670203,910670213,910670287,910670351,910670357,910670359,910670389,910670471}

Still looking for 10 consecutive primes.

***

Simon wrote of Nov 1, 2018

Using the algorithm described below, tested all consecutive prime sets of length 4,6,8,10 up to the prime 218775961, sets of length 12 up to the prime 195194897
Found no consecutive set of primes of length 10 or 12.

Sum any 7 of 8 to get a prime:
{69398759, 69398761, 69398779, 69398789, 69398803, 69398807, 69398821, 69398831}
{120009433, 120009541, 120009551, 120009553, 120009563, 120009619, 120009629, 120009641}
{130095619, 130095701, 130095731, 130095733, 130095739, 130095803, 130095877, 130095887}

Sum any 5 of 6 to get a prime:
{9733, 9739, 9743, 9749, 9767, 9769}
{970217, 970219, 970231, 970237, 970247, 970259}
{3218471, 3218473, 3218477, 3218483, 3218503, 3218533}
{5241937, 5241959, 5241961, 5241983, 5241989, 5242021}
{5691893, 5691899, 5691913, 5691919, 5691929, 5691943}
{8445251, 8445259, 8445271, 8445343, 8445377, 8445419}
{8788079, 8788081, 8788121, 8788141, 8788147, 8788151}
{11268497, 11268503, 11268511, 11268527, 11268541, 11268571}
{11881901, 11881913, 11881927, 11881931, 11881957, 11882071}
{16697419, 16697489, 16697497, 16697501, 16697543, 16697581}
{19604623, 19604633, 19604657, 19604677, 19604693, 19604701}
{22057961, 22057963, 22057969, 22058039, 22058051, 22058077}
{22926473, 22926487, 22926517, 22926583, 22926587, 22926593}
{26027723, 26027737, 26027741, 26027747, 26027773, 26027779}
{26939197, 26939201, 26939239, 26939243, 26939249, 26939251}
{38187463, 38187467, 38187493, 38187607, 38187671, 38187683}
{38938153, 38938181, 38938187, 38938243, 38938259, 38938267}
{39901963, 39901997, 39902029, 39902047, 39902063, 39902081}
{45190247, 45190253, 45190261, 45190279, 45190333, 45190337}
{52489691, 52489699, 52489721, 52489729, 52489747, 52489751}
{54887597, 54887627, 54887629, 54887647, 54887689, 54887711}
{58296113, 58296149, 58296167, 58296169, 58296181, 58296211}
{61909753, 61909781, 61909787, 61909807, 61909819, 61909823}
{62686369, 62686387, 62686409, 62686427, 62686447, 62686469}
{68142289, 68142299, 68142301, 68142311, 68142329, 68142343}
{69567359, 69567401, 69567439, 69567457, 69567461, 69567481}
{69799033, 69799061, 69799063, 69799091, 69799109, 69799123}
{72085687, 72085697, 72085711, 72085721, 72085771, 72085781}
{72973723, 72973763, 72973777, 72973781, 72973799, 72973807}
{79517741, 79517743, 79517777, 79517783, 79517827, 79517863}
{82464511, 82464517, 82464539, 82464553, 82464563, 82464587}
{82792109, 82792117, 82792141, 82792169, 82792181, 82792183}
{88902937, 88902953, 88902997, 88903007, 88903049, 88903063}
{91374029, 91374043, 91374047, 91374061, 91374071, 91374079}
{102004219, 102004249, 102004283, 102004297, 102004319, 102004349}
{106966463, 106966487, 106966507, 106966511, 106966513, 106966543}
{121639181, 121639183, 121639201, 121639247, 121639277, 121639321}
{122052719, 122052727, 122052757, 122052767, 122052779, 122052787}
{124626977, 124627043, 124627049, 124627091, 124627109, 124627121}
{128438207, 128438227, 128438257, 128438293, 128438327, 128438393}
{130755571, 130755607, 130755617, 130755641, 130755643, 130755671}
{139131367, 139131389, 139131397, 139131401, 139131407, 139131427}
{139651189, 139651199, 139651231, 139651261, 139651271, 139651307}
{154908697, 154908731, 154908737, 154908739, 154908763, 154908773}
{160032949, 160032967, 160032989, 160032997, 160033007, 160033031}
{166920179, 166920181, 166920199, 166920203, 166920251, 166920319}
{175310021, 175310059, 175310101, 175310119, 175310129, 175310159}
{175827607, 175827623, 175827637, 175827647, 175827649, 175827677}
{189126473, 189126503, 189126517, 189126527, 189126559, 189126607}
{191001277, 191001287, 191001311, 191001359, 191001367, 191001397}
{196047721, 196047739, 196047749, 196047779, 196047809, 196047853}
{198009953, 198010009, 198010049, 198010081, 198010121, 198010129}
{198621271, 198621281, 198621289, 198621329, 198621337, 198621341}
{199825291, 199825313, 199825319, 199825331, 199825333, 199825363}
{201612769, 201612791, 201612793, 201612811, 201612833, 201612863}
{207464149, 207464161, 207464171, 207464197, 207464219, 207464261}

Description of the algorithm in C#/Linq:
Load the first 105000000 primes from drive into ram.
Make a hashset of the primes to easily check if a number is contained in the hashset.
for (int i = 0; i <  10829000; i++) // i means index to primes hashset. When summing up 11 primes, do not go above the largest loaded prime in the hashset.
{
foreach (int setLength in new int[] { 4, 6, 8, 10, 12 })
{
List<int> set = _primes.Skip(i).Take(setLength).ToList();
if (GetOrderedSubSets(set, setLength - 1).All(subSet => _primes.Contains(subSet.Sum())))
{
Log(string.Join(", ", set));
}
}
}
public static IEnumerable<IEnumerable<T>> GetOrderedSubSets<T>(IEnumerable<T> list, int length) where T : IComparable
{
if (length == 1) return list.Select(t => new T[] { t });
return GetOrderedSubSets(list, length - 1).SelectMany(t => list.Where(e => t.All(g => g.CompareTo(e) == -1)), (t1, t2) => t1.Concat(new T[] { t2 }));
}

***

Emmanuel wrote on Oct 2, 2018:

Q1.
This is the smallest example :
{9733, 9739, 9743, 9749, 9767, 9769}
The six sums of five of them are :
{48731, 48733, 48751, 48757, 48761, 48767}.
They happen to be consecutive too !

Q2.
This is the smallest example :
{69398759, 69398761, 69398779, 69398789, 69398803, 69398807, 69398821, 69398831}.
The eight sums of seven of them are :
{485791519, 485791529, 485791543, 485791547, 485791561, 485791571, 485791589, 485791591}
These primes are not consecutive.
I could not find an example below 4.6*10^9 in which the eight sums were consecutive.

For an example with ten consecutive primes with prime sums of nine of them we should search among primes greater than 10^10.

***

 Records   |  Conjectures  |  Problems  |  Puzzles