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: 
[Perl 6](http://perl6.org/), 34 bytes
=====================================

```
->\a{first {all ($_..*)Z%%a},^∞}

```

[Try it online!](https://tio.run/##FclRCoMgAIfxq/wJGzVakOYiVh5kROJDQmA0bC8hvu8UO9wu4vTt9/G9FmvuYTtx0RjDTUzK6dUebzhlDAoi6/paPvNc@Wr@fb4@HOpERiRGAadBpM@gd4uBoQUXFQYewRIoGDi6xBY9aBx9iqZBFwcDFY/wBw "Perl 6 – Try It Online")
[Ruby](https://www.ruby-lang.org/), 48 bytes
============================================

```ruby
->l{1+(1..1/0.0).find{|x|l.all?{|y|(x+=1)%y<1}}}

```

[Try it online!](https://tio.run/##FclBCsIwEEDRfU/RjdDScewkDaVg9SAhi4oEhFGKIDRkcvaY7N7nf3@PkP2azzeONHSESJcRxx796/OMcgjjxnyPEqQ7hpX6U7hSSilbq2EC46C1pkBXKNBgYK6cYAFVxlKDCOYyNCjn8L3tUViavbUM3rJzTcp/ "Ruby – Try It Online")