In number theory, a vampire number (or true vampire number) is a composite natural number with an even number of digits, that can be factored into two natural numbers each with half as many digits as the original number, where the two factors contain precisely all the digits of the original number, in any order, counting multiplicity. The two factors cannot both have trailing zeroes. The first vampire number is 1260 = 21 × 60.^{[1]}^{[2]}
Let be a natural number with digits:
Then is a vampire number if and only if there exist two natural numbers and , each with digits:
such that , and are not both zero, and the digits of the concatenation of and are a permutation of the digits of . The two numbers and are called the fangs of .
Vampire numbers were first described in a 1994 post by Clifford A. Pickover to the Usenet group sci.math,^{[3]} and the article he later wrote was published in chapter 30 of his book Keys to Infinity.^{[4]}
n | Count of vampire numbers of length n |
---|---|
4 | 7 |
6 | 148 |
8 | 3228 |
10 | 108454 |
12 | 4390670 |
14 | 208423682 |
16 | 11039126154 |
1260 is a vampire number, with 21 and 60 as fangs, since 21 × 60 = 1260 and the digits of the concatenation of the two factors (2160) are a permutation of the digits of the original number (1260).
However, 126000 (which can be expressed as 21 × 6000 or 210 × 600) is not a vampire number, since although 126000 = 21 × 6000 and the digits (216000) are a permutation of the original number, the two factors 21 and 6000 do not have the correct number of digits. Furthermore, although 126000 = 210 × 600, both factors 210 and 600 have trailing zeroes.
The first few vampire numbers are:
The sequence of vampire numbers is:
There are many known sequences of infinitely many vampire numbers following a pattern, such as:
Al Sweigart calculated all the vampire numbers that have at most 10 digits.^{[5]}
A vampire number can have multiple distinct pairs of fangs. The first of infinitely many vampire numbers with 2 pairs of fangs:
The first with 3 pairs of fangs:
The first with 4 pairs of fangs:
The first with 5 pairs of fangs:
Pseudovampire numbers (disfigurate vampire numbers) are similar to vampire numbers, except that the fangs of an n-digit pseudovampire number need not be of length n/2 digits. Pseudovampire numbers can have an odd number of digits, for example 126 = 6 × 21.
More generally, more than two fangs are allowed. In this case, vampire numbers are numbers n which can be factorized using the digits of n. For example, 1395 = 5 × 9 × 31. This sequence starts (sequence A020342 in the OEIS):
A vampire prime or prime vampire number, as defined by Carlos Rivera in 2002,^{[6]} is a true vampire number whose fangs are its prime factors. The first few vampire primes are:
As of 2007^{[update]} the largest known is the square (94892254795 × 10^{103294} + 1)^{2}, found by Jens K. Andersen in September, 2007.^{[2]}
A double vampire number is a vampire number which has fangs that are also vampire numbers, an example of such a number is 1047527295416280 = 25198740 × 41570622 = (2940 × 8571) × (5601 × 7422) which is the smallest double vampire number.
A Roman numeral vampire number is vampire number that uses Roman numerals instead of base-10. An example of this number is II × IV = VIII.