[seqfan] Re: An interesting problem

Chris Scussel scussel at kwom.com
Sun Jul 2 20:52:11 CEST 2023

```If n=4m and both 4m-1 and 4m+1 are prime then the following permutation satisfies the conditions:

4m,  1,  4m-2,  3,  4m-4,  5,  4m-6, ...  2,  4m-3

because the sums of adjacent terms are either 4m-1 or 4m+1.

Regards,
Chris

---- Original Message ----
From: "Yifan Xie" <xieyifan4013 at 163.com>
Sent: 7/2/2023 12:47:41 PM
To: "SequenceFansMailingList" <seqfan at list.seqfan.eu>
Subject: [seqfan] An interesting problem

Hi,
I recently discovered a problem:
For an integer n>=2, there exists a sequence {a(n)} consisting of 1, 2, 3, ... , n that for all 1<=i<=n, the sum of a(i) and a(i+1) is a prime.
Do all integers n>=2 satisfy the above condition?
The easiest algorithm to find a possible sequence is that all terms are the largest possible ones. For example, for n=5, the sequence starts with 5, since 5+4 and 5+3 are not primes, the next term is 2. Similarly, thw whole sequence is {5, 2, 3, 4, 1}.
I tested this algorithm for n<=10^4 and found that only 2108 and 7288 failed.
Can anyone help?

Cheers,
Yifan Xie (xieyifan4013 at 163.com)

--
Seqfan Mailing list - http://list.seqfan.eu/

```