login
A378322
Triangle read by rows: T(n,k) is the number of permutations (x_1, x_2, ..., x_k) such that 1/x_1 + 2/x_2 + ... + k/x_k = k, where x_1, x_2, ... x_k are distinct values between 1 and n.
1
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 3, 3, 4, 1, 1, 1, 3, 3, 4, 1, 1, 1, 1, 3, 5, 10, 11, 12, 1, 1, 1, 3, 6, 16, 40, 54, 30, 1, 1, 1, 3, 7, 25, 88, 184, 206, 102, 1, 1, 1, 3, 7, 25, 88, 184, 206, 102, 1, 1, 1, 1, 3, 13, 56, 244, 744, 1329, 1623, 746, 749, 1, 1, 1, 3, 13, 56, 244, 744, 1329, 1623, 746, 749, 1, 1
OFFSET
1,9
EXAMPLE
Triangle T(n,k) begins:
n\k | 1 2 3 4 5 6 7 8 9
----+------------------------------
1 | 1;
2 | 1, 1;
3 | 1, 1, 1;
4 | 1, 1, 2, 1;
5 | 1, 1, 2, 1, 1;
6 | 1, 1, 3, 3, 4, 1;
7 | 1, 1, 3, 3, 4, 1, 1;
8 | 1, 1, 3, 5, 10, 11, 12, 1;
9 | 1, 1, 3, 6, 16, 40, 54, 30, 1;
...
T(9,1)=1 1/1 = 1
T(9,2)=1 1/1 + 2/2 = 2
T(9,3)=3 1/1 + 2/2 + 3/3 = 3
1/1 + 2/4 + 3/2 = 3
1/2 + 2/1 + 3/6 = 3
T(9,4)=6 1/1 + 2/2 + 3/3 + 4/4 = 4
1/1 + 2/3 + 3/9 + 4/2 = 4
1/1 + 2/4 + 3/6 + 4/2 = 4
1/1 + 2/8 + 3/4 + 4/2 = 4
1/2 + 2/1 + 3/3 + 4/8 = 4
1/2 + 2/1 + 3/6 + 4/4 = 4
PROG
(Julia) using Combinatorics
function T(n, k)
X = [i for i =1:n] |> x->permutations(x, k)
Y = []
for x ∈ X
if sum(i//x[i] for i=1:k) == k
push!(Y, x)
end
end
Y |> length
end
(PARI) T(n, k)={my(c=0); forsubset([n, k], v, forperm(v, p, if(sum(i=1, #p, i/p[i])==k, c++))); c} \\ Andrew Howroyd, Nov 23 2024
(Python)
from math import isqrt, comb, prod
from itertools import combinations, permutations
def A378322(n):
a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
b = n-comb(a, 2)
c = 0
for p in combinations(range(1, a+1), b):
q = prod(p)
t = [(i+1)*q for i in range(b)]
for r in permutations(p, b):
if sum(t[i]//r[i] for i in range(b))==t[b-1]:
c += 1
return c # Chai Wah Wu, Dec 03 2024
CROSSREFS
Sequence in context: A146289 A214575 A081418 * A088951 A361633 A186006
KEYWORD
nonn,tabl
AUTHOR
Dan Shimizu, Nov 23 2024
EXTENSIONS
More terms (rows n=10-13) from Alois P. Heinz, Nov 24 2024
STATUS
approved