Most credit card number can be validated using the Luhn algorithm, which is more or a less a glorified Modulo 10 formula!
For more information about cards, seeCredit Cards Validates: Visa, MasterCard, Elo, American Express, Discover Network, Hipercard, Diners Club, Aura, Maestro, Good Card, JCB, Sorocred