[Question]
  [
In math, one way to figure out what the type of a given relation (linear, quadratic, etc) is to calculate the differences. To do so you take a list of y values for which the gap between the correspondent x values is the same, and subtract each one from the number above it, creating a list of numbers one shorter then the previous list. If the resultant list is completely composed of identical numbers, then the relation has a difference of 1 (it is linear). If they are not identical, then you repeat the process on the new list. If they are now identical, the relation has a difference of 2 (it is quadratic). If they are not identical, you simply continue this process until they are. For example, if you have the list of y values `[1,6,15,28,45,66]` for incrementally increasing x values:
```
First Differences:
1
6   1-6  =-5
15  6-15 =-9
28  15-28=-13
45  28-45=-17
66  45-66=-21
Second differences:
-5 
-9  -5+9  =4
-13 -9+13 =4
-17 -13+17=4
-21 -17+21=4
As these results are identical, this relation has a difference of 2
```
## Your Task
Write a program or function that, when given an array of integers as input, returns the difference of the relation described by the array, as explained above.
## Input
An array of integers, which may be of any length>1.
## Output
An integer representing the difference of the relation described by the input.
## Test Cases
```
Input                            => Output
[1,2,3,4,5,6,7,8,9,10]           => 1
[1,4,9,16,25,36]                 => 2
[1,2,1]                          => 2 (when there is only one value left, all values are automatically identical, so the largest difference an array can have is equal to the length of the array-1)
"Hello World"                    => undefined behavior (invalid input)
[1,1,1,1,1,1,1,1,1]              => 0 (all elements are already identical)
[1, 3, 9, 26, 66, 150, 313, 610] => 6
```
## Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), lowest score in bytes in each language wins for that language. Lowest score overall gets the green checkmark.
  
[Answer]
# [Husk](https://github.com/barbuz/Husk), 6 bytes
Thanks [Leo](https://codegolf.stackexchange.com/users/62393/leo) for letting me use his version that works for `[1,1,1,1,1,1]`
```
←VE¡Ẋ-
```
[Try it online!](https://tio.run/##yygtzv7//1HbhDDXQwsf7urS/f//f7ShjomOpY6hmY6RqY6xWSwA "Husk – Try It Online")
### Explanation
```
   ¡     Repeatedly apply function, collecting results in a list
    Ẋ-     Differences
 VE      Get the index of the first place in the list where all the elements are equal
←        Decrement
```
[Answer]
# JavaScript (ES6), 47 bytes
```
f=a=>-a.every(x=>i=!x)||1+f(a.map(n=>n-a[++i]))
```
### Test cases
```
f=a=>-a.every(x=>i=!x)||1+f(a.map(n=>n-a[++i]))
console.log(f([1,2,3,4,5,6,7,8,9,10]))    // 1
console.log(f([1,4,9,16,25,36]))          // 2
console.log(f([1,2,1]))                   // 2
console.log(f([1,1,1,1,1,1,1,1,1]))       // 0
console.log(f([1,3,9,26,66,150,313,610])) // 6
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
`dta}x@q
```
[Try it online!](https://tio.run/##y00syfn/PyGlJLG2wqHw//9oQx0THUsdQzMdI1MdY7NYAA "MATL – Try It Online") Or [verify all test cases](https://tio.run/##y00syfmf8D8hpSSxtsKh8H@sS8j/aEMdIx1jHRMdUx0zHXMdCx1LHUODWC6gsAmIaaZjZKpjbAYWMNIxBNNoECymYKyjYKmjYGSmo2AGxIamBkAhQ6CgGdA0AA).
### Explanation
This compuntes consecutive differences iteratively until the result is all zeros or empty. The output is the required number of iterations minus 1.
```
`      % Do... while
  d    %   Consecutive diffferences. Takes input (implicitly) the first time
  t    %   Duplicate
  a    %   True if any element is nonzero. This is the loop condition
}      % Finally (execute before exiting the loop)
  x    %   Delete. This removes the array of all zeros
  @    %   Push iteration index
  q    %   Subtract 1. Implicitly display
       % End (implicit). Proceed with next iteration if top of the stack is true
```
[Answer]
# [R](https://www.r-project.org/), ~~50~~ 44 bytes
```
function(l){while(any(l<-diff(l)))F=F+1
F*1}
```
[Try it online!](https://tio.run/##K/qfZqP7P600L7kkMz9PI0ezujwjMydVIzGvUiPHRjclMy0NKKip6Wbrpm3I5Vb7P00jWcNQx9BMx8hCx8RUx8xMU/M/AA "R – Try It Online")
Takes a `diff` of `l`, sets it to `l`, and checks if the result contains any nonzero values. If it does, increment `F` (initialized as `FALSE` implicitly), and returns `F*1` to convert `FALSE` to `0` in the event that all of `l` is identical already.
[Answer]
# Mathematica, 49 bytes
```
(s=#;t=0;While[!SameQ@@s,s=Differences@s;t++];t)&  
```
*thanx @alephalpa for -6 bytes and @hftf -1 byte*
and here is another approach from @hftf
# Mathematica, 49 bytes
```
Length@NestWhileList[Differences,#,!SameQ@@#&]-1&
```
[Answer]
# [Perl 6](https://perl6.org), 37 bytes
```
{($_,{@(.[] Z- .[1..*])}...*.none)-2}
```
[Try it online!](https://tio.run/##dY5BCsIwEEX3nmLALhL5DZ2kGSul4jksRVzUlVbRlZSePaabEkSZxcD8N5/36J9XCbc3ZRdqwqiyE8aDMm1Hx5xMy8ZsOj2ZuMxwH3qd2ynUq9d5flCKIWAPW6H0ENG6pjU1e7IJYeFQIsbYosIOXCwYJ1g5RwLr4f718M/71yxMkTAulluJhtG2gGMHSTQkfAA "Perl 6 – Try It Online")
**Explanation:** The function takes the input as one list. It then builds a recursive sequence like this: the first element is the original list (`$_`), the next elements are returned by `{@(@$_ Z- .[1..*])}` being called on the previous element, and that is iterated until the condition `*.none` is true, which happens only when the list is either empty or contains only zeroes (or, technically, other falsey values). We then grab the list and subtract 2 from it, which forces it first to the numerical context (and lists in numerical context are equal to the number of their elements) and, at the end, returns 2 less than the number of elements in the list.
The weird block `{@(@$_ Z- .[1..*])}` just takes the given list (`.[]` — so called *Zen slice* — indexing with empty brackets yields the whole list), zips it using the minus operator (`Z-`) with the same list without the first element (`.[1..*]`) and forces it to a list (`@(...)` — we need that because zip returns only a Seq, which is basically an one-way list that can be iterated only once. Which is something we don't like.) And that's it.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
-Iß$E?‘
```
[Try it online!](https://tio.run/##y0rNyan8/1/X8/B8FVf7Rw0z/v//H22oo2Cso2Cpo2BkpqNgBsSGpgZAIUOgoJmhQSwA "Jelly – Try It Online")
## Explanation
```
-Iß$E?‘  Input: array A
     ?   If
    E    All elements are equal
         Then
-          Constant -1
         Else
   $       Monadic chain
 I           Increments
  ß          Recurse
      ‘  Increment
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~10~~ 7 bytes
```
è@=ä-)d
```
[Try it online!](https://ethproductions.github.io/japt/?v=1.4.5&code=6EA95C0pZA==&input=WzEsIDMsIDksIDI2LCA2NiwgMTUwLCAzMTMsIDYxMF0=)
Relies on the fact that the result is guaranteed to be within the length of the input array.
## Explanation
```
è@=ä-)d     Implcit input of array U
 @          For each value in U...
  =ä-)      Update U to be equal to its subsections, each reduced by subtraction
      d     Check if any values in that are truthy
è           Count how many items in that mapping are true
```
By the end, this will map the array  
`[1, 3, 9, 26, 66, 150, 313, 610]` to `[true, true, true, true, true, true, false, false]`,  
which contains `6` `true`s.
## Previous 10 byte version
```
@=ä-)e¥0}a
```
[Try it online!](https://ethproductions.github.io/japt/?v=1.4.5&code=QD3kLSllpTB9YQ==&input=WzEsIDMsIDksIDI2LCA2NiwgMTUwLCAzMTMsIDYxMF0=)
[Answer]
# Java 8, ~~191 + 58 = 249~~ ~~198~~ 140 bytes.
Thanks PunPun1000 for 51 bytes.  
Thanks Nevay for 58 bytes.
```
int f(int[]a){int x=a.length-1,b[]=new int[x];for(;x-->0;)b[x]=a[x+1]-a[x];return java.util.Arrays.stream(a).distinct().count()<2?0:1+f(b);}
```
[Try it Online!](https://tio.run/##jY/PboMwDMbP61PkmKgmItBmf1g37QF26hFxMBS6MAhVEjoqxLN3QVsvPSFLtmx/n/xzjWcMulOp68P39dTnjSpI0aC15BOVHlfWoVPFVWlHKupzmiEb527YIW9KfXRfgYA8zXa6/CGzYMiSqjM0GYLgLUxY7gc7TIe1yAKcl6Z0vdGk9od571TDP4zBi@XWmRJbiowflHVKF44yXnS99vU1eg9fxLqiOUumG@YfGjl36kBaD0v3zih9TDOC5mjZuHrYX6wrW971jp/8yjWaVvTGmZFRQAQxbGALEh7hCZ5BhBNjyRLnZlZLiLYQy6WeCMRS6V0stcWeKpIgJYhtCLGIQf6/NE3XXw)
[Try it Online (198 byte version)](https://tio.run/##jY8xb4MwEIXn5ld4tMXFwpC4rVwPHTt0yhgxGGJSE2IibFIixG9PTZqoUidk6fmke9/pvUqd1bI5aVvtDtdTl9emQEWtnEOfythh4bzyprga61GJg24zRYYqQLTzpqbOt1od6Yf1m9uEDvJv@d626uLuHqyImK5UUtFa273/WjJxO5hLq7/RNFaZMCU@0J1x3tjCY0KLprPhl5KRVvuutSgWunYalU075UG9jEX/Vok@iki@7TOpgiyDRCwTd4RFJc6JGB8Ff0uhc2N26Bhq4hDe2P02Q6rdOzIsnjYX5/WRNp2np7DytcUlfsTM0MAggRRWsAYOz/ACr8DikRAxh1xNbg7JGlI@l0mAzbX@e3OxNKRKOHAObB1DylLg90rjeP0B)
So, this is my first time posting here in PPCG (and the first time ever doing a code golf challenge). Any constructive criticism is welcome and appreciated. I tried to follow the guidelines for posting, if anything's not right feel free to point it out.
Beautified version:
```
int f(int[] a) {
    int x = a.length - 1, b[] = new int[x];
    for (; x-- > 0;) {
        b[x] = a[x + 1] - a[x];
    }
    return java.util.Arrays.stream(a).distinct().count() < 2 ? 0 : 1 + f(b);
}
```
[Answer]
# Haskell, 46 bytes
```
g l|all(==l!!0)l=0|0<1=1+g(zipWith(-)l$tail l)
```
this simply recurses - `zipWith(-)l$last l` is the difference list of `l`. and `g` is the function that answers the question.
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), ~~98~~ 94 bytes
```
a->{int o=0,i,z=1;for(;z!=0;o++)for(i=a.length-1,z=0;i>o;a[i]-=a[--i])z|=a[o]^a[i];return~-o;}
```
[Try it online!](https://tio.run/##rZAxT8MwEIX3/opjS1TbjVMIIJNKLEgMTGWLgmTatLi4dpQ4RW0Jfz2cS6iQYKo4efCd7c/vvZXcSGrLwqzmr13ZPGs1g5mWdQ0PUhnYDwaAVTvp8GChjNSwwiescUqzRWNmTlnDHu29cXd9d6OMy/IJGEg7SSd7bMGmEVFkl3KxsFUgdmdpJOxwGPpOpZLpwizdC@V4JRJqYoXMVE5TmVGq8nD3jjubP/mhqArXVOaDWtF2Xpv4kthr75VurJrDGh0EU1cps8xykNWyDtEQ9DXd1q5YM9s4VuIVp01gmCxLvb2t0U1gijc4OIE9JxATGBM4J3BBICFwSeCKwDUBHrVhKDxvNAJ@IhyBHLkxIs89P/lmHgvh8enK@S/ef8H/Xj@/Q3h0Inx8SDhOfCI@oQhHHIfJMXSEJwd4O2i7Tw "Java (OpenJDK 8) – Try It Online")
[Answer]
# [Kotlin](https://kotlinlang.org), 77 bytes
first post, tried to edit last answer on kotlin 2 times ;D
```
{var z=it;while(z.any{it!=z[0]})z=z.zip(z.drop(1),{a,b->a-b});it.size-z.size}
```
took testing part from @jrtapsell
[TryItOnline](https://tio.run/##hVHBauMwEL3nK6ZhDxJMTJw03jatA4VmoVDYw/a27EFN5FZUkY006RIbf3t2JLdh2UN2jJH85r2Z8Zu3mqxxx3flwS3Fowl0@@BoJScrPqA8djHTloZufr8aq0WbKXfoDF2U7c/pr162ZZu1pmF86@tG5BI7hc@TlZo89/LGUBZMqydtOvrjVpGCjVUhwJMOdM@fIjYwrtnTEk7tESJa7ynBjMjRqNo72CnjhPIvYQl33qvD7Q/yxr2sJHQj4HhXFgzpXYASLBf7XomExzg1/EjkOMM5XuICC/yKV3iN@VQi8B@ckVxGWoGzBc4LJs/OkmeY/5fzz8P86Vk@zBGuuWiBUPCbL6YM5QwWafpCJi3b9WlHpYyNdiRbsp1qoOM7UA1O8HqS8xL6rDKWtE9JvvtA2WA/XERtFvSmdlvoh8KmApEKZyasdw0dhPxcQYyGl0LWiXGcHxpet96Oh8l60Dbov7hDmar2a7V5he4k/Xb38Li@X8IXQ2PZD9pRf/wD)
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), ~~22~~ 17 bytes
```
{1=≢∪⍵:0⋄1+∇2-/⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/2tD2UeeiRx2rHvVutTJ41N1iqP2oo91IVx/Ir/3v9qhtAl4VXI/6pgLVuCk86t1saPAfAA "APL (Dyalog Classic) – Try It Online")
Thanks to @ngn for -5 bytes!
## How?
* `{ ... }`, the function
* `1=≢∪⍵:0`, if every element is equal in the argument, return `0`
* `1+∇2-/⍵`, otherwise, return 1 + `n` of the differences (which is `n-1`, thus adding one to it gives `n`)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
IÐĿEÐḟL
```
[Try it online!](https://tio.run/##y0rNyan8/9/z8IQj@10PT3i4Y77P////ow11LHSMzHXMTHQMjUxjAQ "Jelly – Try It Online")
# Explanation
```
IÐĿEÐḟL  Main link
 ÐĿ      While results are unique (which is never so it stops at [])
I        Take the increments, collecting intermediate values # this computes all n-th differences
    Ðḟ   Filter out
   E     Lists that have all values equal (the first n-th difference list that is all equal will be removed and all difference lists after will be all 0s)
      L  Take the length (this is the number of iterations required before the differences become equal)
```
-1 byte thanks to Jonathan Allan
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
```
[DË#¥]N
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/2uVwt/KhpbF@QKahjoKxjoKljoKRmY6CGRAbmhoAhQyBgmaGBrEA "05AB1E – Try It Online")
**Explanation**
```
[         # start loop
 D        # duplicate current list
  Ë       # are all elements equal?
   #      # if so, break
    ¥     # calculate delta's
     ]    # end loop
      N   # push iteration counter
```
[Answer]
## JavaScript (ES6), 58 bytes
```
f=a=>+(b=a.slice(1).map((e,i)=>e-a[i])).some(e=>e)&&1+f(b)
```
[Answer]
# [Python 2](https://docs.python.org/2/), 65 bytes
*-7 bytes thanks to Jonathan Allan.*
```
f=lambda l,c=1:any(l)and f([j-i for i,j in zip(l,l[1:])],c-1)or-c
```
[Try it online!](https://tio.run/##FcpBCsMgEEDRq8xSYYRMSoUGcpLgwhqkE6ajSDbJ5a1d/M3j1@v8FJ17z6vE73uPIJhWWqJeRmzUHbLZDseQSwPGA1jh5moEZaMl2IDJkS3NpV4b6/nfCeGB8EKYPYIf0XMaRAM9TcH2Hw "Python 2 – Try It Online")
[Answer]
# Dyalog APL, 19 bytes
```
≢-1+(≢2-/⍣{1=≢∪⍵}⊢)
```
Explanation:
```
≢                      length of input
 -1+(             )    minus 1+
     ≢                 length of
      2-/              differences between elements
         ⍣             while
          {1=≢∪⍵}      there is more than 1 unique element
                 ⊢     starting with the input
```
[Answer]
# [k](https://en.wikipedia.org/wiki/K_(programming_language)), 21 bytes
```
#1_(~&/1_=':)(1_-':)\
```
This works in k, but not in oK, because oK's while loop runs before checking the condition (as opposed to first checking the condition, and then running the code). Therefore, in oK, the `1 1 1 1 1` example will not work properly.
[Try oK online!](https://tio.run/##LYlLCoAwEEOvMiBohYhNa8dP8SZCd9248AZevc5CQj683NNzt1aPjsW9/cxyDsfoWCarq9XBEQERCxIUKzbsoM80YEMREqJmShBa/rJbImSHBIWomckbokGlH9sH "K (oK) – Try It Online")
[![Running the k example with 1 1 1 1 1 1 in the k interpreter.](https://i.stack.imgur.com/phCLe.png)](https://i.stack.imgur.com/phCLe.png)
Explanation:
```
   (        )       \ /while(
    ~&/               /      not(min(
       1_=':          /              check equality of all pairs))) {
             (1_-':)  /    generate difference list
                      /    append to output }
#1_                   /(length of output) - 1
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~66~~ ~~61~~ 60 bytes
```
z=(=<<tail).zipWith
f=length.takeWhile(or.z(/=)).iterate(z(-))
```
[Try it online!](https://tio.run/##ZY/LCoMwEEXX9SsG6SKBMTU@0gpm3z9wUVwETGswVbFZ5edt2k0h5TKbM2cY7qhek7Z2370ksm2dMpYyb9bOuDG5S6vnhxuZU5PuRmM1WTbmyUlSyozTm3KaeJJRuj@VmUHCsEByWDczOzjCHW4cCyyxwhoFnvGCDfK8j4zqQwUWNZai/7vmMYoSr6FEaBAKgSDC8DoPiAcovp@zDH56eg3VF@iWzQ7p/gY "Haskell – Try It Online")
*Saved 5 bytes thanks to Christian Sievers*
*Saved 1 byte thanks to proud-haskeller*
`iterate(z(-))` computes the differences lists.
`or.z(/=)` tests if there are non equal elements in those lists.
`length.takeWhile` counts the differences lists with non equal elements.
[Answer]
# [Japt](https://github.com/ETHproductions/japt/), 7 bytes
Same approach (but independently derived) as [Justin](https://codegolf.stackexchange.com/a/142473/58974) with a different implementation.
```
£=äaÃèx
```
[Test it](https://ethproductions.github.io/japt/?v=1.4.5&code=oz3kYcPoeA==&input=WzEsNiwxNSwyOCw0NSw2Nl0=)
---
## Explanation
Implicit input of array `U`.
```
£   Ã
```
Map over each element.
```
äa
```
Take each sequential pair (`ä`) of elements in `U` and reduce it by absolute difference (`a`).
```
=
```
Reassign that array to `U`.
```
èx
```
Count (`è`) the number of sub-arrays that return truthy (i.e., non-zero) when reduced by addition.
[Answer]
# TI-Basic, 19 bytes
```
While max(abs(ΔList(Ans
ΔList(Ans
IS>(A,9
End
A
```
By default, variables start at zero. Also, never thought I'd be using `IS>(` for anything useful.
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~70~~ 69 + 18 bytes
*-1 byte thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)*
```
g=a=>i=>a.Distinct().Count()>1?g(a.Zip(a.Skip(1),(y,z)=>y-z))(i+1):i;
```
Must be given 0 when calling to operate correctly. Also included in byte count:
```
using System.Linq;
```
[Try it online!](https://tio.run/##XVDLTsMwEDw3X2FOtcU2ihsaHm2CUHkICSRED0jcjGuFFa4TYgf6UL89OI1aBGtpZz2zlmdX2oEsKtXUFk1OZivr1CJ8QPM5DoxYKFsKqfb0tNBaSYeFseGdMqpCGWwC4kNqYS252tUd04Z1wqEkXwXOyaNAQ9lB2gS9Fm5rIyf3N6ZeqEq8aTVB4zLoaF8Cae8ZyUlKTK31uMlTkWaYZiK8RuvQSEeZ91Ubjxm/zKkIX7H0efbhgTOgKyBrlmarwZoxisecXeC4OfjobFbt7GjK2o3/KN/vqBWhdCd5D1M/eaFV@KzE3O9IUcbIUWeNBb3eXn6p0KmdnndPw1mp0dE@9Fk4U@0O6ZKkWTtd@CQqq@iSeXcRY7//b4MubxsOQ4jhBEaQwCmcwTnwKOCe8EUCwxHESdD2cJ//Hc/Evm2YQJIAH0UQ8xgSHv0A "C# (.NET Core) – Try It Online")
Explanation:
```
g = a => i =>                      // Function taking two arguments (collection of ints and an int)
    a.Distinct()                   // Filter to unique elements
    .Count() > 1 ?                 // If there's more than one element
        g(                         //     Then recursively call the function with
            a.Zip(                 //     Take the collection and perform an action on corresponding elements with another one
                a.Skip(1),         //         Take our collection starting at second element
                (y, z) => y - z    //         Perform the subtraction
            )
        )(i + 1)                   //     With added counter
        : i;                       // Otherwise return counter
```
Iterative version 84 + 18 bytes:
```
a=>{int i=0;for(;a.Distinct().Count()>1;i++)a=a.Zip(a.Skip(1),(y,z)=>y-z);return i;}
```
[Try it online!](https://tio.run/##VVBNSwMxEL3vrxhPTXAb7DnNgtQPBAVxD4K3mE51MM2u@dB@0N@@Ji219B1mknkv4c0zYWw6j0MK5D6gXYeIS/FI7ltWTi8x9NrgcTzrrEUTqXNB3KNDT6baVpBhrA4Brvfnw6QgRB3JwE9Hc3jS5Bj/p06igrvkzPTh1qUlev1ucUouNjWUCgtQg1bNNl@A1JVcdJ5JLW4oRHImMp5tJZd7M5F0ecm10uKNeqZF@5XbhNdsXW@4atbjDZceY/IOSO4GWZ15CNGXBMj1Kcoz5veTLAJjewoUzPL@nUXxgnqek0LGOVwocMlafvaw4Ch@9RRxr14cPhJtbymyUT3iosWSK1uBasrS4ln7gGzFM05WdtWh7oY/ "C# (.NET Core) – Try It Online")
[Answer]
## Clojure, 62 bytes
```
#(loop[c % i 0](if(apply = c)i(recur(map -(rest c)c)(inc i))))
```
Nicely `=` can take any number of arguments, and a single argument is identical to "itself". `(apply = [1 2 3])` gets executed as `(= 1 2 3)`.
[Answer]
# [Pyth](https://pyth.readthedocs.io), 15 bytes
```
W.E.+Q=.+Q=hZ)Z
```
**[Verify all the test cases.](https://pyth.herokuapp.com/?code=W.E.%2BQ%3D.%2BQ%3DhZ%29Z&input=%5B1%2C6%2C15%2C28%2C45%2C66%5D&test_suite=1&test_suite_input=%5B1%2C4%2C9%2C16%2C25%2C36%5D%0A%5B1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%5D%0A%5B1%2C2%2C1%5D%0A%5B1%2C1%2C1%2C1%2C1%2C1%5D%0A%5B1%2C+3%2C+9%2C+26%2C+66%2C+150%2C+313%2C+610%5D&debug=0)**
# How?
### Explanation #1
```
W.E.+Q=hZ=.+Q)Z   ~ Full program.
W                 ~ While...
 .E.+Q            ~ ... The deltas of Q contain a truthy element.
      =hZ         ~ Increment a variable Z, which has the initial value of 0.
         =        ~ Transform the variable to the result of a function applied to itself...
          .+Q     ~ ... Operate on the current list and deltas.
             )Z   ~ Close the loop and output Z.
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
⁽¯İ~aL
```
[Try it online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwi4oG9wq/EsH5hTCIsIiIsIlsxLDIsMyw0LDUsNiw3LDgsOSwxMF1cblsxLDQsOSwxNiwyNSwzNl1cblsxLDIsMV1cblsxLDEsMSwxLDEsMSwxLDEsMV1cblsxLCAzLCA5LCAyNiwgNjYsIDE1MCwgMzEzLCA2MTBdIl0=)
Explanation:
```
⁽¯      # Single element lambda that gets the differences
  İ     # Apply that and collect results until no change
   ~    # Filter by:
    a   #   Any truthy?
     L  # Get the length of those
```
[Answer]
# [J](http://jsoftware.com/), 21 18 bytes
```
2#@(}.~.)2-/\^:a:]
```
[Try it online!](https://tio.run/##TYzNCoJAEIDvPsWYgSuN286aCw4KUtApOnQ1@yGS6NIDRL36thr@MMxhv2@/edrMZ6qNz1kYejMZNlAwhICggN3GEjaH3dbqoBQf@ZWRjpfHE1@5tpG3X0uoOOfSyVi@ORKtraPWd1LQouI5/@lFcSkFFUHpzkzaIRKUd27Iz9rlLZre9e63xwsaIFxhhmRQp5iYgYIGGh/djAUkCBmCNgjGLaXKIXLQkOp/qX7sDw "J – Try It Online")
*-3 thanks to rdm!*
[Answer]
# [Perl 5](https://www.perl.org/), 83 + 1 (-a) = 84 bytes
```
sub c{$r=0;$r||=$_-$F[0]for@F;$r}for(;c;$i=0){$_-=$F[++$i]for@F;$#F--}say y/ //-$#F
```
[Try it online!](https://tio.run/##K0gtyjH9/7@4NEkhuVqlyNbAWqWopsZWJV5XxS3aIDYtv8jBDShUC2RoWCdbq2TaGmhWA2VtgdLa2iqZMBXKbrq6tcWJlQqV@gr6@rpA/v//hgomCpYKhmb/8gtKMvPziv/r@prqGRga/NdNBAA "Perl 5 – Try It Online")
Input as a list of numbers separated by one space.
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 11 bytes
```
W$D}ltoK)Ko
```
[Try it here!](http://pyke.catbus.co.uk/?code=W%24D%7DltoK%29Ko&input=%5B1%2C+3%2C+9%2C+26%2C+66%2C+150%2C+313%2C+610%5D&warnings=1&hex=0)
[Answer]
# Pyth, 10 bytes
```
tf!t{.+FQt
```
If we can index from 1, we can save a byte by removing the leading `t`.
[Try it Online](http://pyth.herokuapp.com/?code=tf!t%7B.%2BFQt&input=[1%2C4%2C9%2C16%2C25%2C36]&debug=0)
Explanation
```
tf!t{.+FQt
 f        T  Find the first (1-indexed) value T...
     .+FQt   ... such that taking the difference T - 1 times...
  !t{        ... gives a set with more than one value in it.
t            0-index.
```
]