I'm working on a curious math problem
I'm trying to figure out how many permutations for a set of n integers (1..n),
With the constraint:
$\sum\limits_{i=1}^{n} x_ii = c$
Such that c is a known constant, and $x_i$ is one of the whole numbers 1..n with no repeats.
Note that this is a special case of the actual problem I'm trying to solve
$\sum\limits_{i=1}^{n} x_iy_i = c$ such that $y_i$ belong to a known ordered set,
but I'm assuming the first problem is similar to this one and can be solved with minor tweaks once the first problem is understood.
Another way of looking at this is linear algebra, how many $x$ vectors are there
$x \cdot k$ = c
Such that x is a vector of integers $1..n$, not repeating (is there a special name for such a vector?) and $k=<1,2,3..n>$
So,
since
$x \cdot k = ||x|| ||k|| \cos \theta = c$ where theta is the angle between x and k
But we don't know $\theta$ of course.
However, $||x|| = ||k|| = \sqrt{\sum\limits_{i=1}^{n} i^2} = [n(n+1)(2n+1)]/6$
so
$x \cdot k = [n(n+1)(2n+1)]/6] \cos \theta = c$
Therefore, another way of looking at it, is how many angles exist such that
$\cos \theta = c/[n(n+1)(2n+1)]/6$
Ok, hmm, did I go wrong somewhere or do we know $\theta$? I think it helps, but I don't know the plane(s) to rotate $k$ on. Though it does have a different way of looking at the problem I suppose.