What are vampire numbers?
Introduction to Vampire Number and its implementation using python.
Introduction
In mathematics, a vampire number (or true vampire number) is a composite natural number v, with an even number of digits n, that can be factored into two integers x and y each with n/2 digits and not both with trailing zeroes, where v contains precisely all the digits from x and from y, in any order, counting multiplicity. x and y are called the fangs.
Examples:
The vampire numbers are:
1260, 1395, 1435, 1530, 1827, 2187, 6880, 102510, 104260, 105210, 105264, 105750, 108135, 110758, 115672, 116725, 117067, 118440, 120600, 123354, 124483, 125248, 125433, 125460, 125500, … (sequence A014575 in the OEIS)
There are many known sequences of infinitely many vampire numbers following a pattern, such as:
1530 = 30×51, 150300 = 300×501, 15003000 = 3000×5001, …
Condition for a number to be Vampire Number: