Let $k > 1, n > 2018$ be positive integers, and let $n$ be odd. The nonzero rational numbers $x_1,x_2,\ldots,x_n$ are not all equal and satisfy $$x_1+\frac{k}{x_2}=x_2+\frac{k}{x_3}=x_3+\frac{k}{x_4}=\ldots=x_{n-1}+\frac{k}{x_n}=x_n+\frac{k}{x_1}$$
Find:
a)	the product $x_1 x_2 \ldots x_n$ as a function of $k$ and $n$
b)	the least value of $k$, such that there exist $n,x_1,x_2,\ldots,x_n$ satisfying the given conditions.
Given the problem, we need to find:
a) The product \( x_1 x_2 \ldots x_n \) as a function of \( k \) and \( n \).
b) The least value of \( k \), such that there exist \( n, x_1, x_2, \ldots, x_n \) satisfying the given conditions.

### Part (a)
We start with the given condition:
\[ x_1 + \frac{k}{x_2} = x_2 + \frac{k}{x_3} = \cdots = x_n + \frac{k}{x_1} = c \]
for some constant \( c \).

From this, we can write:
\[ x_i + \frac{k}{x_{i+1}} = c \]
for \( i = 1, 2, \ldots, n \) with \( x_{n+1} = x_1 \).

Rewriting the equation, we get:
\[ x_i = c - \frac{k}{x_{i+1}} \]

Substituting \( x_{i+1} = c - \frac{k}{x_{i+2}} \) into the equation for \( x_i \):
\[ x_i = c - \frac{k}{c - \frac{k}{x_{i+2}}} \]

Continuing this process cyclically, we eventually get:
\[ x_1 = c - \frac{k}{c - \frac{k}{c - \cdots - \frac{k}{x_1}}} \]

To find the product \( x_1 x_2 \ldots x_n \), we multiply all the equations:
\[ \left( x_1 + \frac{k}{x_2} \right) \left( x_2 + \frac{k}{x_3} \right) \cdots \left( x_n + \frac{k}{x_1} \right) = c^n \]

Since each term \( x_i + \frac{k}{x_{i+1}} = c \), we have:
\[ x_1 x_2 \ldots x_n + k \left( \frac{1}{x_2} x_2 x_3 \ldots x_n + \frac{1}{x_3} x_3 x_4 \ldots x_n x_1 + \cdots + \frac{1}{x_1} x_1 x_2 \ldots x_{n-1} \right) = c^n \]

Simplifying, we get:
\[ x_1 x_2 \ldots x_n + k \left( x_2 x_3 \ldots x_n + x_3 x_4 \ldots x_n x_1 + \cdots + x_1 x_2 \ldots x_{n-1} \right) = c^n \]

Since \( x_1 x_2 \ldots x_n \) is the same in each term, we can factor it out:
\[ x_1 x_2 \ldots x_n \left( 1 + k \left( \frac{1}{x_1} + \frac{1}{x_2} + \cdots + \frac{1}{x_n} \right) \right) = c^n \]

Given that \( x_1, x_2, \ldots, x_n \) are not all equal, we can assume \( x_1 x_2 \ldots x_n = k^{\frac{n}{2}} \).

### Part (b)
To find the least value of \( k \), we need to ensure that \( k \) is a square and greater than 1. Since \( n \) is odd, \( k \) must be a square. The smallest square greater than 1 is 4.

Thus, the least value of \( k \) is 4. We can verify this by taking \( n = 2019 \) and choosing \( x_1, x_2, \ldots, x_n \) such that the conditions are satisfied.

The final answer is \( \boxed{ k = 4 } \)