Vampire number: Difference between revisions

m
added whitespace, also clarified that vampire numbers (for this task) are numbers expressed in base ten.
m (→‎{{header|REXX}}: added/changed comments and whitespace, optimized the VAMPIRE function.)
m (added whitespace, also clarified that vampire numbers (for this task) are numbers expressed in base ten.)
Line 1:
{{task|Mathematics}}
 
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 digits of the original number
* together they consist of exactly the same digits as the original number
* at most one of them has a trailing zero
 
These two factors are called the   ''fangs'',   and must have the following properties:
<br>
::* &nbsp; they each contain half the number of the decimal digits of the original number
An example of a Vampire number and its fangs: <code> 1260 : (21, 60) </code>
::* &nbsp; together they consist of exactly the same decimal digits as the original number
::* &nbsp; at most one of them has a trailing zero
 
 
An example of a Vampirevampire number and its fangs: &nbsp; <code> 1260 : (21, 60) </code>
 
 
;Task:
# Print the first &nbsp; '''25''' &nbsp; Vampirevampire numbers and their fangs.
# Check if the following numbers are Vampirevampire numbers and, &nbsp; if so, &nbsp; print them and their fangs:
<big><code> 16758243290880, 24959017348650, 14593825548650 </code></big>
 
 
<br>
Note that a Vampirevampire 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/ Vampirevampire search algorithm]
* [[oeis:A014575|Vampirevampire numbers on OEIS]]
<br><br>