ISBN

Author

Eric W. Weisstein
January 3, 2007

This notebook downloaded from http://mathworld.wolfram.com/notebooks/CodingTheory/ISBN.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ISBN.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Code

ISBNCheck[n_Integer]:=Module[{d=Most[IntegerDigits[n]],s},
Switch[Length[d],
_?(#≤9&),
{s=PadLeft[d,9].Range[10,2,-1],11-Mod[s,11]},
12,{s=d.{1,3,1,3,1,3,1,3,1,3,1,3},
10-Mod[s,10]},
_,$Failed
]
]

Examples

http://www.bisg.org/isbn-13/conversions.html

ISBNCheck[0940016737]

ISBNCheck[9780940016736]

Eric's Book

ISBNCheck[0849396409]

Mod[266,11]

11-Mod[266,11]

ISBNCheck[9780849396403]