A347601
a(n) is the number of positive Euler permutations of order n.
Original entry on oeis.org
1, 0, 0, 2, 7, 16, 102, 1042, 8109, 63280, 642220, 7500626, 89458803, 1135216800, 15935870034, 241410428162, 3858227881945, 65327424977824, 1176448390679256, 22388999178300514, 447692501190569823, 9395318712874789744, 206713705368363820990, 4755693997171333347506
Offset: 0
Illustrating the decomposition of the rencontres numbers and the Euler numbers:
The third column is the sum of the first two columns and the fourth column is the difference between the first two. The fourth column is the sum of the last two.
[n] A347601 A347602 A000166 A347598 A122045 A347597
--------------------------------------------------------------------------
[ 0] 1, 0, 1, 1, 1, [0]
[ 1] 0, 0, 0, 0, 0, 0,
[ 2] 0, 1, 1, -1, -1, [0]
[ 3] 2, 0, 2, 2, 0, 2,
[ 4] 7, 2, 9, 5, 5, [0]
[ 5] 16, 28, 44, -12, 0, -12,
[ 6] 102, 163, 265, -61, -61, [0]
[ 7] 1042, 812, 1854, 230, 0, 230,
[ 8] 8109, 6724, 14833, 1385, 1385, [0]
[ 9] 63280, 70216, 133496, -6936, 0, -6936,
[10] 642220, 692741, 1334961, -50521, -50521, [0].
-
using Combinatorics
function TangentMatrix(N)
M = zeros(Int, N, N)
H = div(N + 1, 2)
for n in 1:N - 1
for k in 0:n - 1
M[n - k, k + 1] = n < H ? 1 : -1
M[N - n + k + 1, N - k] = n < N - H ? -1 : 1
end
end
M end
function EulerPermutations(n, sgn)
M = TangentMatrix(n)
S = 0
for p in permutations(1:n)
sgn == prod(M[k, p[k]] for k in 1:n) && (S += 1)
end
S end
PositiveEulerPermutations(n) = EulerPermutations(n, 1)
-
# Uses function TangentMatrix from A346831.
EulerPermutations := proc(n, sgn) local M, P, N, s, p, m;
M := TangentMatrix(n); P := 0; N := 0;
for p in Iterator:-Permute(n) do
m := mul(M[k, p(k)], k = 1..n);
if m = 0 then next fi;
if m = 1 then P := P + 1 fi;
if m = -1 then N := N + 1 fi; od;
if sgn = 'pos' then P else N fi end:
A347601 := n -> `if`(n = 0, 1, EulerPermutations(n, 'pos')):
seq(A347601(n), n = 0..8);
A347602
a(n) is the number of negative Euler permutations of order n.
Original entry on oeis.org
0, 0, 1, 0, 2, 28, 163, 812, 6724, 70216, 692741, 7183944, 86756038, 1155576132, 16135231015, 239656087572, 3838836369800, 65522667301840, 1178853270354697, 22361732381344592, 447322130002332298, 9399988542176154796, 206783054242756958891, 4754731473884444589756
Offset: 0
-
# Uses function EulerPermutations from A347601.
A347602 := n -> `if`(n = 0, 0, EulerPermutations(n, 'neg')):
seq(A347602(n), n = 0..8);
A347599
Irregular table read by rows, T(n, k) is the rank of the k-th Genocchi permutation of {1,...,n}, permutations sorted in lexicographical order. If no Genocchi permutation of {1,...,n} exists, then T(n, 1) = 0 by convention.
Original entry on oeis.org
1, 0, 5, 0, 67, 91, 92, 0, 1897, 2017, 2018, 2617, 2619, 2737, 2738, 2739, 2740, 3457, 3458, 3459, 3460, 4177, 4178, 4179, 4180, 0, 99241, 99961, 99962, 104281, 104283, 105001, 105002, 105003, 105004, 110041, 110042, 110043, 110044, 115081, 115082, 115083
Offset: 1
Table starts:
[1] 1;
[2] 0;
[3] 5;
[4] 0;
[5] 67, 91, 92;
[6] 0;
[7] 1897, 2017, 2018, 2617, 2619, 2737, 2738, 2739, 2740, 3457, 3458, 3459, 3460, 4177, 4178, 4179, 4180;
.
The 17 permutations corresponding to the ranks are for n = 7:
1897 -> [3571246]; 2017 -> [3671245]; 2018 -> [3671254]; 2617 -> [4571236];
2619 -> [4571326]; 2737 -> [4671235]; 2738 -> [4671253]; 2739 -> [4671325];
2740 -> [4671352]; 3457 -> [5671234]; 3458 -> [5671243]; 3459 -> [5671324];
3460 -> [5671342]; 4177 -> [6571234]; 4178 -> [6571243]; 4179 -> [6571324];
4180 -> [6571342].
.
17 / (-510) = -1/30 = Bernoulli(8).
-
using Combinatorics
function GenocchiPermutations(n)
f(m) = m >= n ? 1 : m < 0 ? -1 : 0
Mat(n) = [[f(2*j - k) for k in 1:n] for j in 1:n]
M = Mat(n); P = permutations(1:n); R = Int64[]
S, rank = 0, 1
for p in P
m = prod(M[k][p[k]] for k in 1:n)
if m != 0
S += m
push!(R, rank)
end
rank += 1
end
# println(n, " ", S, " ", S // (2^(n + 2) - 2)) # Bernoulli number
return R
end
for n in 1:11 println(GenocchiPermutations(n)) end
A347766
Irregular table read by rows, T(n, k) is the rank of the k-th positive Euler permutation of {1,...,n}, permutations sorted in lexicographical order. If no such permutation exists, then T(n, 0) = 0 by convention.
Original entry on oeis.org
1, 0, 0, 2, 3, 1, 6, 8, 11, 14, 15, 17, 3, 8, 24, 28, 29, 30, 32, 35, 50, 55, 57, 68, 71, 74, 79, 92, 2, 6, 15, 16, 21, 26, 30, 40, 44, 54, 55, 60, 68, 99, 104, 120, 121, 123, 124, 125, 137, 138, 142, 143, 144, 146, 150, 161, 164, 167, 174, 175, 177, 179, 185
Offset: 0
Table of positive Euler permutations, length of rows is A347601:
[0] 1;
[1] 0;
[2] 0;
[3] 2, 3;
[4] 1, 6, 8, 11, 14, 15, 17;
[5] 3, 8, 24, 28, 29, 30, 32, 35, 50, 55, 57, 68, 71, 74, 79, 92.
.
The 16 permutations corresponding to the ranks are for n = 5:
3 -> [12435], 8 -> [13254], 24 -> [15432], 28 -> [21453],
29 -> [21534], 30 -> [21543], 32 -> [23154], 35 -> [23514],
50 -> [31254], 55 -> [32145], 57 -> [32415], 68 -> [35142],
71 -> [35412], 74 -> [41253], 79 -> [42135], 92 -> [45132].
-
# Uses function TangentMatrix from A346831.
EulerPermutationsRank := proc(n, sgn) local M, P, N, s, p, m, rank;
M := TangentMatrix(n); P := []; N := []; rank := 0;
for p in Iterator:-Permute(n) do
rank := rank + 1;
m := mul(M[k, p(k)], k = 1..n);
if m = 0 then next fi;
if m = 1 then P := [op(P), rank] fi;
if m = -1 then N := [op(N), rank] fi; od;
if sgn = 'pos' then P else N fi end:
A347766Row := n -> `if`(n < 3, [[1,0,0][n+1]], EulerPermutationsRank(n, 'pos')):
for n from 0 to 5 do A347766Row(n) od;
A347767
Irregular table read by rows, T(n, k) is the rank of the k-th negative Euler permutation of {1,...,n}, permutations sorted in lexicographical order. If no such permutation exists, then T(n, 0) = 0 by convention.
Original entry on oeis.org
0, 0, 1, 0, 2, 7, 4, 5, 6, 7, 10, 12, 19, 20, 27, 31, 33, 43, 44, 47, 49, 52, 54, 56, 59, 69, 73, 78, 80, 83, 86, 87, 89, 93, 1, 3, 4, 5, 17, 18, 22, 23, 24, 25, 27, 28, 29, 37, 38, 42, 43, 46, 48, 51, 52, 53, 56, 58, 61, 62, 66, 67, 72, 100, 101, 102, 103, 106
Offset: 0
Table of negative Euler permutations, length of rows is A347602:
[0] 0;
[1] 0;
[2] 1;
[3] 0;
[4] 2, 7;
[5] 4, 5, 6, 7, 10, 12, 19, 20, 27, 31, 33, 43, 44, 47, 49, ...
.
The first 8 permutations corresponding to the ranks are for n = 5:
4 -> [12453], 5 -> [12534], 6 -> [12543], 7 -> [13245],
10 -> [13452], 12 -> [13542], 19 -> [15234], 20 -> [15243].
-
# Uses function EulerPermutationsRank from A347766.
A347767Row := n -> `if`(n < 4, [[0,0,1,0][n+1]], EulerPermutationsRank(n, 'neg')): for n from 0 to 6 do A347767Row(n) od;
Showing 1-5 of 5 results.
Comments