Subject: RE: CCL:CAS Registry Numbers algorithm

From: "Shobe, Dave" <[email-masked]>
Date: Fri, 25 May 2001 09:35:45 -0400

I made a slight but important mistake: "prime relative to the base" should
be "relatively prime to the base".  I.e. the numbers that do not share
commmon factors with the base (except for 1 of course).  The advantage of
using a prime number base (such as 11 in ISBN) is that there are fewer
non-relatively-prime-to-the-base numbers.  However, base 10 has the
advantage of not introducing extra symbols into the character set (like the
X in ISBN).

Actually it's pretty easy to design an algorithm that "catches" more errors:
simply use two digits.  The first digit could be from the current algorithm,
which will catch any transposition; the second digit could simply be the sum
of all the digits, modulo 10, which would catch any single substitution.
You might even be able to design one that catches a single digit omission as
well.

However, the saying that nothing is foolproof given the constant ingenuity
of fools comes to mind.

--Dave

"Shobe, Dave" wrote:

> Come to think of it: the algorithm might catch transposition errors, but a
> single-digit error such as 5555-31-7 vs. 5555-81-7 would not be detected,
if
> the digits differ by 5 in an even position, or if they differ by an even
> number in the 5th position.
>
> The ISBN algorithm doesn't have this problem since 11 is prime.  However
any
> error the 11th digit would be completely undetectable.  You could fix this
I
> suppose by only using digit multipliers that are prime relative to the
base.

>
> Thus an improved(?) CAS RN algorithm would take 1234-31-? and calculate
> 1*1+3*3+4*7+3*9+2*11+1*13.  However, now the multiplers for adjacent
digits
> would differ by 2 or 4 instead of 1, and a transposition of the type
> 5555-38-7 vs. 5555-83-7 would not be detected since 3*8+3=27 and 3*3+8=17.