Validate ISBN-10 and ISBN-13 book numbers with check digit verification.
ISBN (International Standard Book Number) uniquely identifies books. ISBN-10 uses a weighted sum modulo 11, where the check digit can be 0-9 or X (representing 10). ISBN-13 uses alternating weights of 1 and 3 modulo 10.