|
|
A349277
|
|
Triangle T(n,k), n >= 1, 1 <= k <= n, read by rows, where T(n,k) is the number of permutations p of [n] such that Sum_{j=1..n} j/p(j) is an integer and p(n) = k.
|
|
2
|
|
|
1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 2, 1, 1, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 8, 4, 4, 2, 2, 0, 2, 0, 8, 18, 18, 14, 18, 0, 14, 0, 0, 22, 113, 130, 102, 135, 108, 122, 0, 314, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1128, 1152, 1166, 1130, 1078, 1334, 1182, 0, 1734, 3390, 1226, 0, 1128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14520
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,15
|
|
LINKS
|
|
|
FORMULA
|
If n is prime, T(n,k) = 0 for 1 <= k <= n-1.
|
|
EXAMPLE
|
Triangle begins:
1;
0, 1;
0, 0, 1;
1, 0, 0, 1;
0, 0, 0, 0, 2;
1, 1, 2, 2, 0, 2;
0, 0, 0, 0, 0, 0, 8;
4, 4, 2, 2, 0, 2, 0, 8;
18, 18, 14, 18, 0, 14, 0, 0, 22;
113, 130, 102, 135, 108, 122, 0, 314, 0, 104;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1128;
|
|
PROG
|
(Ruby)
def A(n)
ary = Array.new(n, 0)
(1..n).to_a.permutation{|i|
ary[i[-1] - 1] += 1 if (1..n).inject(0){|s, j| s + j / i[j - 1].to_r}.denominator == 1
}
ary
end
(1..n).map{|i| A(i)}.flatten
end
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|