
Vampire Numbers  John Childs  
Digits in vampire number  Numbers in range (i.e. 10 to 99 = 90 numbers 
Number of multiplications to be performed  Number of vampire numbers  Per cent of total  Multiplication rate (#'s/hr)* 
Time to search all possibilities 
Time increase factor 
4  90  4,095  7  0.2  29,000,000  0.5 sec  . 
6  900  405,450  148  0.04  16,000,000  1.5 min  180x 
8  9,000  40,504,500  3243  0.008  14,000,000  2.5 hours  100x 
10  90,000  4,050,045,000  108,577  0.003  6,500,000  26 days  250x 
12  900,000  405,000,450,000  ?  ?  5,500,000  8.4 years  120x 
14  9,000,000  4.05 E+13  .  .  3,600,000  1,3000 years  150x 
16  90,000,000  4.05 E+15  .  .  .  .  . 
18  900,000,000  4.05 E +17  .  .  .  .  . 
20  9,000,000,000  4.05 E +19  .  .  2,000,000  2.3 billion years  . 
22  9 E +10  4.05 E +21  .  .  .  .  . 
24  9 E +11  .  .  .  .  .  . 
26  9 E +12  .  .  .  .  .  . 
28  9 E +13  .  .  .  .  .  . 
30  9 E + 14  .  .  .  .  .  . 
32  9 E + 15  .  .  .  .  .  . 
34  9 E + 16  .  .  .  .  .  . 
36  9 E + 17  .  .  .  .  .  . 
38  9 E + 18  .  .  .  .  .  . 
40  9 E + 19  .  .  .  600,000  1 E +30 years  . 
50  9 E +24  .  .  .  365,000  2 E +40 years  . 
60  9 E +29  .  .  .  300,000  2 E +50 years  . 
100  9 E +49  .  .  .  100,000  5 E +90 years  . 
* These times are approximate, and are measured using a Turbo Pascal program running on a Pentium 133 MHz. (IBM ThinkPad 365 XD, 1995 vintage!) Notice that there is a big drop in the multiplication rate between 4 digits and 6 digits. This is because integer variables can be used to search for 4 digit vampire numbers, and longinteger variables need to be used to search for 6 digit vampire numbers. Integer variables can store numbers in the range 32,768 to + 32,767. (+/ 2 raised to the 15th power  the reason for this number is that the biggest 16 bit binary number you can have is 1111111111111111 which equals 32,768 in decimal, or base 10.) Since a four digit number only goes to 9,999 integer variables are fine, and the computer is very fast in processing them! For 6 digit numbers (largest = 999,999) and 8 digit numbers, (largest = 99,999,999) the longinteger variable stores numbers in the range 2,147,483,648 to + 2,147,483,647. To get larger integer values, two 16 bit binary numbers are used, and 2 raised to the 30th power is 2,147,483,648. Since this is a ten digit number, you might think it could be used to multiply two 5 digit numbers to get a 10 digit result. But notice that it can not store the larger numbers up to 9,999,999,999 since it can't go beyond 2 billion. So it is only useful to get 8 digit products, to a maximum value of 99,999,999.
Notice again, that there is a big drop in the multiplication rate when we move to 10 digit products. At this point, we are using numbers up to 9,999,999,999 which exceeds the computer's integer capacity entirely. At this point, the computer can no longer supply us with numeric variables to do the job, and we have to do it manually. It's not often that the computer actually lets us down! But we really have exceeded the computer's ability to do the arithmetic in which we are interested. At this point, all our nubmers are actually arrays of numbers. A 10, 12 or more digit number is stored with digits, each in its own cell, in an array with 10 or 12 elements.
Vampire Numbers  Information SummaryBack 