RosettaCodeData/Task/Vampire-number/00-TASK.txt
2023-07-01 13:44:08 -04:00

26 lines
1.1 KiB
Text

A [[wp:Vampire_number|vampire number]] is a natural decimal number with an even number of digits,   that can be factored into two integers.
These two factors are called the   ''fangs'',   and must have the following properties:
::*   they each contain half the number of the decimal digits of the original number
::*   together they consist of exactly the same decimal digits as the original number
::*   at most one of them has a trailing zero
An example of a vampire number and its fangs: &nbsp; <code> 1260 : (21, 60) </code>
;Task:
# Print the first &nbsp; '''25''' &nbsp; vampire numbers and their fangs.
# Check if the following numbers are vampire numbers and, &nbsp; if so, &nbsp; print them and their fangs:
<big><code> 16758243290880, 24959017348650, 14593825548650 </code></big>
Note that a vampire number can have more than one pair of fangs.
;See also:
* [http://www.numberphile.com/videos/vampire_numbers.html numberphile.com].
* [http://users.cybercity.dk/~dsl522332/math/vampires/ vampire search algorithm]
* [[oeis:A014575|vampire numbers on OEIS]]
<br><br>