Question: Sometimes to fall asleep, I'll count as high as I can, whilst skipping numbers that are not [square-free](https://en.wikipedia.org/wiki/Square-free_integer). I get a little thrill when I get to skip over several numbers in a row - for example, `48,49,50` are all NOT square-free (48 is divisible by 2^2, 49 by 7^2, and 50 by 5^2).

This led me to wondering about the earliest example of adjacent numbers divisible by some arbitrary sequence of divisors.

Input
-----

Input is an ordered list `a = [a_0, a_1, ...]` of strictly positive integers containing at least 1 element.

Output
------

Output is the smallest positive integer `n` with the property that `a_0` divides `n`, `a_1` divides `n+1`, and more generally `a_k` divides `n+k`. If no such `n` exists, the function/program's behavior is not defined.

Test Cases
----------

```
[15] -> 15
[3,4,5] -> 3
[5,4,3] -> 55
[2,3,5,7] -> 158
[4,9,25,49] -> 29348
[11,7,5,3,2] -> 1518

```

Scoring
-------

This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"); shortest result (per language) wins bragging rights. The usual loopholes are excluded.

Answer: 
[MATL](https://github.com/lmendo/MATL), 11 bytes
================================================

```
`Gf@q+G\a}@

```

[Try it online!](https://tio.run/##y00syfn/P8E9zaFQ2z0msdbh//9oUx0THeNYAA "MATL – Try It Online")

```
`           % Do ....
 Gf         %   Convert input to [1,2,...,]
   @q+      %   Add current iteration index minus one, to get [n, n+1, ....]
      G\    %   Elementwise mod([n,n+1,...],[a_0,a_1,...])
        a   % ...while any of the modular remainders is nonzero.
         }  % Finally:
          @ %   Output the iteration index.

```

Not exactly optimized for speed... the largest testcase takes a full minute using MATL, and approximately 0.03s on MATLAB. There is a small possibility MATL has a bit more overhead.
[Python 2](https://docs.python.org/2/), 80 bytes
================================================

```python
def f(l,n=1):
 while n:
	n+=1
	if all((n+i)%v<1for i,v in enumerate(l)):return n

```

[Try it online!](https://tio.run/##FY7BCoQgFEXX@RVvM6D0NmoSSX1JtAhGSXBeIdYwX@/o7lzOXZzrl4@TVClv58HziLRIYRl8jxAdkGUd9YtkXfCwx8g59UG8nln6M0HABwKBo/vj0p4dj0LY5PKdCKi0R25@1Tig2RBWU0E3UKjR4NhwwAlVFVMbUuJYhUa11Qa4UqBcq7Iofw "Python 2 – Try It Online")