cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

2, 8, 12, 32, 960, 12288, 40320, 1296384, 13862592, 126186000, 4703871392, 153495217056, 4312093043076, 225409456295800, 7671288697001460
Offset: 1

Views

Author

DoZerg (daidodo(AT)gmail.com), Feb 01 2007

Keywords

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

Examples

			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.
		

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