Given an integer n, I want to find two permutations of the numbers 1 to n (inclusive) such that the sum of numbers from the two permutations at any given index is always prime.
For example:
n = 5
1 2 3 4 5
1 5 4 3 2
n = 8
1 2 3 4 5 6 7 8
2 1 4 3 8 7 6 5