I know you are asking, "what the heck is a vampire number!?" I don't blame you, that's exactly what I thought when I bumped into them. Well, here's the story.... It all began when I read the "Brain Bogglers" page in the June '95 issue of Discover magazine. I noticed that the author was Clifford Pickover, whom I knew from some of the fractal programs that I have of his, and from some of the wonderful books he has written. I usually don't bother with the Brain Boggler page, because I never have the patience to try and figure them out. But this one was different. Rather than try and explain it, here it is...
Brain Bogglers Interview With A Number by Clifford Pickover
If we are to believe best-selling novelist Anne Rice, vampires resemble humans in many respects but live secret lives hidden among mortals. There are also vampires in the world of mathematics, numbers that look like normal figures but bear a disguised difference. They are actually the products of two progenitor numbers that when multiplied survive, scrambled together, in the vampire number. Consider one such case: 27 x 81 = 2,187.
Another vampire number is 1,435, which is the product of 35 and 41. I define true vampires, such as the two previous examples, as meeting three rules. They have an even number of digits. Each one of the progenitor numbers has half the number of digits of the vampire. And finally, a true vampire number is not created simply by adding zeros to the ends of numbers, as in:
270,000 x 810,000 = 218,700,000,000.
True vampires would never be so obvious. Vampire numbers secretly inhabit our number system, but most have been undetected so far. When I grabbed my silver mirror and wooden stake and began my search for them, I found, in addition to the two listed above, five other four-digit vampire numbers. Can you find the others? Can you find any vampire numbers with more digits in them? Answer
The "Answer" box listed the other five four-digit true vampires. It also mentioned that there are 155 six-digit vampire numbers. Ah ha! modify that code and get the computer looking for more!...
And what about the eight-digit vampires, the ten-digit vampires....!
The "Answer" box went on to say...
"In fact there are many larger vampire numbers. Recently I challenged computer scientists and mathematicians around the world to submit the largest vampire number they could find. The current world record is: 1,234,554,321 x 9,162,361,086 = 11,311,432,469,283,552,606.
If you can find a new world record, or if you would like more information, please write to Clifford A. Pickover, c/o Discover, 114 Fifth Avenue, New York, N.Y. 10011-5690"
Well, needless to say I was off to the races! This was going to involve some serious programming. (read "fun"!) Pascal allows double precision integer variables, which store 16 digits of accuracy. This allows you to find all the eight-digit vampire numbers, because their product ends up as a 16 digit number. But how to exceed the 16 digit double precision variable limit of Pascal? To find a new record size number, you have to wite the code to do all the arithmetic individual digit by individual digit. You just can't say Result := Num1 * Num2 anymore! There was no other way but to write the code to handle the giant numbers in a special way. Each single digit of each number in its own cell in an array, with a two dimensional array to hold the results, and then add up the columns, doing the carrys of each vertical array column separately, and coming up with the result in another bigger array!
Starting off "small" I got the code working to look for 12 digit vampires. Running overnight on a Pentium, and checking about 35 million multiplications, I found about two dozen! A new world record!! Those curious numbers are out there, and I felt like a mathematical fisherman, casting my computer code net and straining out the vampire numbers! Assuming that other interested programmers were also sifting though the trillions of numbers that are out there, I decided to push for bigger numbers.
Finally, after several days of 24 hour running, on July 5, 1995, at 2:50 am, the computer spit out this 40 digit vampire number which was, at the time, the new world record.:
98,765,432,198,765,432,198 x 98,765,432,198,798,290,709 = 9,754,610,597,412,176,879,952,378,996,998,032,848,382
Later, there was a new world record! This 60 digit number was found by a student of mine, Paul Batyushkov, at 9:20 am on March 3rd, 1999.
987,654,321,098,765,576,932,096,123,487 x 987,654,321,098,765,432,110,091,621,255 =
Then, six days later, a bigger vampire number!
This 100 digit MEGA monster was found by another student of mine, Myles Hilliard, at 1 am, March 9th, 1999.
x 98,765,432,109,876,543,210,987,654,321,098,765,432,109,967,196,255 =
Update: Feb., 2003
Its been a few years since I had my Pascal program running, so I thought I'd see if I could still find my old files. :-) I found the files on an old CD backup, so I still have the source code. My new computer is a 1.39 GHz machine, and things run 10x faster than they did on my old laptop. (133 MHz) I got lucky, and on my first overnight run I found this new bigger 100 digit vampire number. (Time to quit using the commas.)
x 98765432109876543210987654321099765432110002523486 =
Now that it's 2010, these big numbers are out of date! A lot of programmers doing "real math" have developed sophisticated algorithms over the years to play with vampire numbers. Today, these programs can generate vampire numbers of any desired length!
Even though the "research" has pretty much all been done, this topic makes a great exercise for high school computer science classes. The basic idea is quite straight-forward, and the program can be worked on at various levels of difficulty. Several of my students wrote the basic code to find the smaller vampire numbers, and it is a fun project.
Click here to download a small zip file of programs that find the 6, 8 and 10 digit vampire numbers, and display graphs of where these numbers are. Also included is the Turbo Pascal code that finds the 4 digit vampire numbers. (This code can be viewed in notepad. file = vamfin4.pas) Download 600 kb zip file.
If you found this info helpful, I'd be glad to hear from you. e-mail me.(email@example.com)
Vampire Numbers - A tutorial!