login
A125712
Number of permutations of 1..2n in which the sum of every two adjacent elements is a prime number, including the sum of first and last elements.
0
2, 8, 12, 32, 960, 12288, 40320, 1296384, 13862592, 126186000, 4703871392, 153495217056, 4312093043076, 225409456295800, 7671288697001460
OFFSET
1,1
COMMENTS
For 2n=4 we have a(2) = 8. One of the permutations is 1 4 3 2. Let's check: 1 + 4 = 5 is a prime number; 4 + 3 = 7 is a prime number; 3 + 2 = 5 is a prime number; 2 + 1 = 3 is a prime number; so we say it's a legal permutation.
a(n) = 4*n*A051252(n), n>1. - Vladeta Jovovic, Feb 02 2007
As explicitly checked for 2<=n<=9, a(n)=4*n*A051252(n). This is twice the length of the permutation multiplied by A051252(n), where the factor 4n counts the permutations generated by any of the 2n cyclic shifts or any of the 2n cyclic shifts followed by reversal. The exception is for n=1, where reversal and shift yield the same image of the permutation. - R. J. Mathar, Nov 02 2007
EXAMPLE
a(2) = 8 because we can generate 8 different permutations:
1 2 3 4
1 4 3 2
2 1 4 3
2 3 4 1
3 2 1 4
3 4 1 2
4 1 2 3
4 3 2 1
in which the sum of every two adjacent elements is a prime number, including the sum of first and last elements.
CROSSREFS
Sequence in context: A306898 A069185 A037197 * A062290 A176961 A078541
KEYWORD
nonn,more,changed
AUTHOR
DoZerg (daidodo(AT)gmail.com), Feb 01 2007
EXTENSIONS
a(8) and a(9) from R. J. Mathar, Nov 02 2007
a(10)-a(15) (using A051252) from Alois P. Heinz, Nov 03 2024
STATUS
approved