Detect five consecutive unsorted integers It appears that the product of the differences between 3 consecutive integers in whatever order is always equal to 2. However, I can't find the pattern for 5 integers.

We could sort them and get an easier problem, but I am curious if there is a way to solve it on an unsorted 5 integers array.

Edit: Gentlemen in comments pointed out it works for non sorted 3 integers. Question remains. Is there such a property for 5 integers ?

Edit: 

The product of $|a-b|$ and $|b-c|$ is always 2.

let an integers array x be $3, 1, 2$

we have : $ (|3 - 1|) \cdot (|1 - 2|)$ = 2

Is there such a relation with 5 integers ?
Take any $5$ numbers $a$, $b$, $c$, $d$, $e$ and multiply the absolute differences differences between consecutive numbers. You get
$$
|a-b|\cdot|b-c|\cdot|c-d|\cdot|d-e|
$$

if you imagine to add to each of the five numbers the same constant, it is easy to see that this product does not change, because each difference remain the same.

So, if I'm considering $5$ numbers it does not matter if they are $1,2,3,4,5$ or $14,15,16,17,18$, because the product of the differences among adiacent numbers will remain the same.

Clearly, if we take the $5$ consecutive numbers in their natural order, or in reverse order, the product will be a product of $1$'s, and thus equal to $1$.

But there are $5!=120$ ways to permute $5$ numbers and it turns out that we can have $13$ different products, namely $1$, $2$, $3$, $4$, $6$, $8$, $9$, $12$, $16$, $18$, $24$, $36$, $48$, depending on how we permute them.

Here is a table of the $13$ values, the number of corresponding permutations, and one such permutation.

$$
\begin{array}{c|c|c}
\prod &amp; \sharp &amp; perm.\\\hline
 1 &amp; 2 &amp; 12345 \\
 2 &amp; 4 &amp; 12354 \\
 3 &amp; 4 &amp; 12543 \\
 4 &amp; 18 &amp; 12435 \\
 6 &amp; 20 &amp; 12534 \\
 8 &amp; 12 &amp; 13542 \\
 9 &amp; 6 &amp; 14325 \\
 12 &amp; 8 &amp; 13425 \\
 16 &amp; 12 &amp; 15324 \\
 18 &amp; 8 &amp; 14352 \\
 24 &amp; 12 &amp; 13524 \\
 36 &amp; 10 &amp; 14253 \\
 48 &amp; 4 &amp; 24153
\end{array}
$$

For example, the line that start with $18$ means that it is possible to obtain the product $18$ with $8$ permutations, one being $14352$, which means we take the first number, then the $4$th, then the $3$rd, the $5$th and the second.

For example, for the numbers $18,19,20,21,22$ this means the order 
$18,21,20,22,19$ which indeed gives
$$
|18-21|\cdot|21-20|\cdot|20-22|\cdot|22-19|=3\cdot1\cdot2\cdot3 = 18
$$

The number $T$ of different values and the maximal product $M$ that it is possible to obtain with $k$ consecutive numbers can be summarized as follows, for $k=2,\dots,10$.
$$
\begin{array}{c|ccccccccc}
k&amp;2&amp;3&amp;4&amp;5&amp;6&amp;7&amp;8&amp;9&amp;10\\\hline
T&amp;1&amp; 2 &amp; 6 &amp; 13 &amp; 42 &amp; 92 &amp; 292 &amp; 653 &amp; 1345\\\hline
M&amp; 1 &amp; 2 &amp; 12 &amp; 48 &amp; 432 &amp; 2700 &amp; 32000 &amp; 276480 &amp; 4050000
\end{array}
$$
Is this a serious question?

If $a &lt; b &lt;c &lt; d &lt;e$ are 5 consecutive integers then:

e - a =4

e-b= 3

e-c=2

e-d =1

d-a=3

d-b =2

d-c=1

c-a =2

b-a =1

The product is 4x3x2x1x3x2x1x2x1=288.

Was that a serious question?