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.

This page as a plain text file.
%I A125712 #15 Nov 04 2024 01:43:37
%S A125712 2,8,12,32,960,12288,40320,1296384,13862592,126186000,4703871392,
%T A125712 153495217056,4312093043076,225409456295800,7671288697001460
%N 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.
%C A125712 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.
%C A125712 a(n) = 4*n*A051252(n), n>1. - _Vladeta Jovovic_, Feb 02 2007
%C A125712 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
%e A125712 a(2) = 8 because we can generate 8 different permutations:
%e A125712 1 2 3 4
%e A125712 1 4 3 2
%e A125712 2 1 4 3
%e A125712 2 3 4 1
%e A125712 3 2 1 4
%e A125712 3 4 1 2
%e A125712 4 1 2 3
%e A125712 4 3 2 1
%e A125712 in which the sum of every two adjacent elements is a prime number, including the sum of first and last elements.
%K A125712 nonn,more
%O A125712 1,1
%A A125712 DoZerg (daidodo(AT)gmail.com), Feb 01 2007
%E A125712 a(8) and a(9) from _R. J. Mathar_, Nov 02 2007
%E A125712 a(10)-a(15) (using A051252) from _Alois P. Heinz_, Nov 03 2024