Validating the check digit of IMEI by Luhn algorithm

The check digit of IMEI is required to check the correctness of the entered IMEI number.
If the check digit does not match the calculated one, then the IMEI number is entered incorrectly.

1. Digits of the checked sequentially numbered from right to left.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2. Digits, which turned out to odd places remain unchanged.
3. The digits that standing on even places, multiplied by 2.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4. If the result of this multiplication occurs a number greater than 9, it is replaced by the sum of the digits of the result of multiplying - single digit.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5. All calculated digits are summarized.
If the sum is a multiple of 10, the account number is possibly valid.