login
Lexicographically earliest sequence of distinct positive terms such that if a(n) jumps over a(n) positions towards the right (landing on the integer k), the sum a(n) + k is always prime.
0

%I #20 May 20 2023 14:47:24

%S 1,2,4,5,3,6,7,9,10,8,11,12,13,14,16,17,15,20,21,19,22,23,18,24,25,26,

%T 28,29,27,30,31,37,32,36,33,34,35,38,39,40,46,41,42,45,43,44,47,48,49,

%U 50,54,51,53,55,52,61,56,60,57,58,59,62,66,63,64,65,67,68

%N Lexicographically earliest sequence of distinct positive terms such that if a(n) jumps over a(n) positions towards the right (landing on the integer k), the sum a(n) + k is always prime.

%C a(n) - a(n+k) = k with k odd is forbidden as this would lead to a contradiction. This is why a(4) = 5 here and not a(4) = 3.

%C The sequence is a permutation of the natural numbers.

%e S = 1, 2, 4, 5, 3, 6, 7, 9, 10, 8, 11, 12, 13, ...

%e sum = 5 5 13 13 13 19

%e a(1) = 1 and 1 + 4 = 5 (prime)

%e a(2) = 2 and 2 + 3 = 5 (prime)

%e a(3) = 4 and 4 + 9 = 13 (prime)

%e a(4) = 5 and 5 + 8 = 13 (prime)

%e a(5) = 3 and 3 + 10 = 13 (prime)

%e a(6) = 6 and 6 + 13 = 19 (prime), etc.

%Y Cf. A182115, A230086.

%K nonn

%O 1,2

%A _Eric Angelini_, May 10 2023

%E a(22) and beyond from _Michael S. Branicky_, May 10 2023