Peter and Basil play the following game on a horizontal table $1\times{2019}$. Initially Peter chooses $n$ positive integers and writes them on a board. After that Basil puts a coin in one of the cells. Then at each move, Peter announces a number s among the numbers written on the board, and Basil needs to shift the coin by $s$ cells, if it is possible: either to the left, or to the right, by his decision. In case it is not possible to shift the coin by $s$ cells neither to the left, nor to the right, the coin stays in the current cell. Find the least $n$ such that Peter can play so that the coin will visit all the cells, regardless of the way Basil plays.
To solve this problem, we need to ensure that the coin can visit all cells on the table regardless of Basil's moves. This means that the set of numbers Peter writes on the board must allow the coin to reach any cell from any starting position.

1. **Understanding the Problem:**
   - The table has 2019 cells, indexed from 1 to 2019.
   - Peter writes \( n \) positive integers on the board.
   - Basil places a coin in one of the cells.
   - Peter announces a number \( s \) from the board, and Basil moves the coin \( s \) cells left or right if possible.

2. **Key Insight:**
   - To ensure the coin can visit all cells, the set of numbers must allow the coin to move to any cell from any starting position.
   - This implies that the greatest common divisor (GCD) of the numbers must be 1. If the GCD were greater than 1, the coin could only visit cells that are multiples of this GCD, which would not cover all cells from 1 to 2019.

3. **Finding the Minimum \( n \):**
   - We need to find the smallest set of numbers such that their GCD is 1 and they can generate all possible moves.
   - The smallest set of numbers that satisfies this condition is the set of consecutive integers starting from 1. This is because the GCD of any set of consecutive integers is 1.

4. **Verification:**
   - Consider the set \(\{1, 2, 3, \ldots, k\}\). The GCD of this set is 1.
   - With these numbers, the coin can move to any cell by appropriate combinations of left and right moves.

5. **Conclusion:**
   - The smallest such set is \(\{1, 2\}\). With these two numbers, the coin can move to any cell:
     - Using 1, the coin can move to any adjacent cell.
     - Using 2, the coin can move two cells left or right, allowing it to reach any cell in combination with moves of 1 cell.

Therefore, the least \( n \) such that Peter can ensure the coin visits all cells is \( n = 2 \).

The final answer is \( \boxed{ n = 2 } \).