Step-by-Step: ISBN-10
Step 1: Understand the Format
An ISBN-10 consists of 9 digits followed by a check digit. The check digit ensures the integrity of the ISBN.
Step 2: Calculate the Weighted Sum
Multiply each digit by its position (1 to 9) and sum the products.
Example:
ISBN: 0-306-40615-?
Weighted Sum = (0×1) + (3×2) + (0×3) + (6×4) + (4×5) + (0×6) + (6×7) + (1×8) + (5×9)
= 0 + 6 + 0 + 24 + 20 + 0 + 42 + 8 + 45 = 145
Step 3: Find the Check Digit
Divide the weighted sum by 11. The remainder is the check digit. If the remainder is 10, use 'X'.
Example:
Check Digit = 145 mod 11 = 2
Final ISBN: 0-306-40615-2
Step-by-Step: ISBN-13
Step 1: Understand the Format
An ISBN-13 consists of 12 digits followed by a check digit. It uses alternating weights of 1 and 3.
Step 2: Calculate the Weighted Sum
Multiply each digit alternately by 1 and 3, then sum the results.
Example:
ISBN: 978-0-306-40615-?
Weighted Sum = (9×1) + (7×3) + (8×1) + (0×3) + (3×1) + (0×3) + (6×1) + (4×3) + (0×1) + (6×3) + (1×1) + (5×3)
= 9 + 21 + 8 + 0 + 3 + 0 + 6 + 12 + 0 + 18 + 1 + 15 = 93
Step 3: Find the Check Digit
Take the weighted sum modulo 10. Subtract the result from 10. If the result is 10, use '0'.
Example:
Check Digit = (10 - (93 mod 10)) mod 10
= (10 - 3) mod 10 = 7
Final ISBN: 978-0-306-40615-7