# Competition #4

This competition is organized by Макарова Наталия (Natalia Makarova)

## Definitions

### Definition 1:

A

prime k-tupleis a finite collection of values(p + a1, p + a2, p + a3, …, p + ak), wherep,p + a1,p + a2,p + a3, …,p + akare prime numbers,(a1, a2, a3, …, ak)are pattern. Typically the first value in the pattern is 0 and the rest are distinct positive even numbers.

We consider the k-tuple, where *p + a1*, *p + a2*,* p + a3*, …, *p + ak* are **consecutive primes**.

### Definition 2:

k-tuple

(p + a1, p + a2, p + a3, …, p + a [k / 2], p + a [k / 2+1], …, p + a [k-2], p + a [k-1], p + ak)forkeven, is calledsymmetric, if the following condition is satisfied:

a1 + ak = a2 + a[k-1] = a3 + a[k-2] = … = a[k/2] + a[k/2+1]

Example: symmetric 8-tuple

(17 + 0, 17 + 2, 17 + 6, 17 + 12, 17 + 14, 17 + 20, 17 + 24, 17 + 26)

Shortened we write this:

17: 0, 2, 6, 12, 14, 20, 24, 26

### Definition 3:

k-tuple

(p + a1, p + a2, p + a3, …, p + a [(k-1) / 2], p + a [(k-1) / 2 + 1], p + a [(k-1) / 2 + 2], …, p + a [k-2], p + a [k-1], p + ak)forkodd calledsymmetric, if the following condition is satisfied:

a1 + ak = a2 + a[k-1] = a3 +a [k-2] =…= a[(k-1)/2] + a[(k-1)/2+2] = 2 a[(k-1)/2+1]

Example: symmetric 5-tuple

18713: 0, 6, 18, 30, 36

### Definition 4:

The

diameterd of k-tuple is the difference of its largest and smallest elements.

Example: 8-tuple

17: 0, 2, 6, 12, 14, 20, 24, 26

It has a diameter d = 26.

### Definition 5:

A

pandiagonal magic squareis a magic square with the additional property that the broken diagonals, i.e. the diagonals that wrap round at the edges of the square, also add up to the magic constant.

## The Contest

In the contest is required to compete for those tasks:

**Task 1**

Required to find **k-tuples** with the minimal value p:

for an even** k > 24**; for odd **k > 15**.

Example

15-tuple, p=3945769040698829 (minimal) 3945769040698829: 0, 12, 18, 42, 102, 138, 180, 210, 240, 282, 318, 378, 402, 408, 420

**Task 2**

Required to find **k-tuples** with a **minimal diameter** *d*:

for an even** k > 10**; for odd **k > 13**.

Example

8-tuple with a minimal diameter d = 26

17: 0, 2, 6, 12, 14, 20, 24, 26

**Task 3**

Required to find the **16-tuple**, the elements of which it is possible to make **pandiagonal magic square** of order 4 with magic constant S as: 94615738903617540 < S < 29643562211780078520
Example 16-tuple

23653934725904299: 0, 12, 22, 34, 48, 60, 70, 82, 90, 102, 112, 124, 138, 150, 160, 172

pandiagonal magic square

23653934725904299+ 0 160 60 124 82 102 22 138 112 48 172 12 150 34 90 70 S=94615738903617540

### Rule:

Prime numbers can contain **no more than 100 digits**.

In tasks 1 and 2 k <= 50.

## Format of solution

For every task the first line is the number of task you are entering: so 1, 2 or 3. After there are those lines according to the tasks you are inserting.

In tasks 1 and 2

k-tuple is represented as

p: a1, a2, a3, …, ak

Example

18713: 0, 6, 18, 30, 36

In task 3

it is 16-tuple and pandiagonal magic square of order 4, composed of the elements of the tuple.

Example

23653934725904299: 0, 12, 22, 34, 48, 60, 70, 82, 90, 102, 112, 124, 138, 150, 160, 172 0, 160, 60, 124, 82, 102, 22, 138, 112, 48, 172, 12, 150, 34, 90, 70

## Scoring

The contestant receives one point for every solution to tasks 1 and 3.

For each* k* in task 2 one point counted towards only those participants, who will have a minimum diameter *d*.

## The Prize

If two or more contestants have equal number of points, the winner will be the entrant who submitted solutions ahead of other contestants.

The winner will receive a prize of **5,000 rubles**.

If the winner is not from Russia, the prize will be paid in US dollars at the official exchange rate on the day ending of the contest.

## Thanks

We thanks **Wolfram Alpha** as we use their **API** for testing the primality of the given big numbers.

## Links

[1] https://en.wikipedia.org/wiki/Prime_k-tuple

[2] https://en.wikipedia.org/wiki/Pandiagonal_magic_square

[3] http://oeis.org/A256234

[4] http://oeis.org/A081235

[5] http://oeis.org/A055380

[6] http://oeis.org/A055382

[7] http://oeis.org/A175309

[8] http://www.primepuzzles.net/problems/prob_060.htm

[9] http://dxdy.ru/topic93581.html

[10] http://dxdy.ru/topic87170.html

For problem 2 sequences of length 12 with a minimum diameter is easy to generate thousands – will be given for every point? Then there is no need to look for the rest of the sequence.

It will be give only one point for the entry with minimal diameter for different starting prime number.