A358629 a(n) is the number of signed permutations W of V = (1, 2, ..., n) such that the dot product V*W = 0.
0, 2, 0, 16, 48, 558, 4444, 62246, 692598, 11722730, 196824592, 3896202680, 86626174698, 2018770217402, 51681142218502, 1418482891697258, 41404316055037624, 1304323691188387488, 43501661519771535260, 1538705372277647632786
Offset: 1
Examples
The cases of a(4) = 16 are: [1, 2, 3, 4] * [-4,-1,-2, 3] = -4 - 2 - 6 + 12 = 0. [1, 2, 3, 4] * [-2,-3, 4,-1] = -2 - 6 + 12 - 4 = 0. [1, 2, 3, 4] * [-3,-4, 1, 2] = -3 - 8 + 3 + 8 = 0. [1, 2, 3, 4] * [-4,-3, 2, 1] = -4 - 6 + 6 + 4 = 0. [1, 2, 3, 4] * [-2, 1,-4, 3] = -2 + 2 - 12 + 12 = 0. [1, 2, 3, 4] * [-4, 3,-2, 1] = -4 + 6 - 6 + 4 = 0. [1, 2, 3, 4] * [-2, 1, 4,-3] = -2 + 2 + 12 - 12 = 0. [1, 2, 3, 4] * [-3, 4, 1,-2] = -3 + 8 + 3 - 8 = 0. [1, 2, 3, 4] * [ 4, 1, 2,-3] = 4 + 2 + 6 - 12 = 0. [1, 2, 3, 4] * [ 2, 3,-4, 1] = 2 + 6 - 12 + 4 = 0. [1, 2, 3, 4] * [ 3, 4,-1,-2] = 3 + 8 - 3 - 8 = 0. [1, 2, 3, 4] * [ 4, 3,-2,-1] = 4 + 6 - 6 - 4 = 0. [1, 2, 3, 4] * [ 2,-1, 4,-3] = 2 - 2 + 12 - 12 = 0. [1, 2, 3, 4] * [ 4,-3, 2,-1] = 4 - 6 + 6 - 4 = 0. [1, 2, 3, 4] * [ 2,-1,-4, 3] = 2 - 2 - 12 + 12 = 0. [1, 2, 3, 4] * [ 3,-4,-1, 2] = 3 - 8 - 3 + 8 = 0.
Links
- Bert Dobbelaere, Python program
Programs
-
PARI
a(n) = my(v=[1..n], nb=0); forperm(v, p, for (i=1, 2^(n-1)-1, my(w = vector(n, k, if (bittest(i, k-1), -p[k], p[k]))); if (v*w~ == 0, nb++););); 2*nb; \\ Michel Marcus, Nov 30 2022
-
PARI
a(n)=my(m=n-1,N=2^m-1,s); forperm(n,U, for(i=1,n,U[i]*=2*i); my(t=sum(i=1,n,U[i])/2); for(i=1,N, t+=U[valuation(i,2)+1]*=-1; if(t==0, s++))); 2*s \\ Charles R Greathouse IV, Jan 07 2023
Formula
Trivially, a(n) <= n! * (2^n - 1). - Charles R Greathouse IV, Jan 07 2023
Extensions
a(12)-a(20) from Bert Dobbelaere, Jan 26 2023
Comments