Anonymous user
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.
* 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:
▲::* 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>▼
▲::* together they consist of exactly the same decimal digits as the original number
▲::* at most one of them has a trailing zero
;Task:
# Print the first '''25'''
# Check if the following numbers are
<big><code> 16758243290880, 24959017348650, 14593825548650 </code></big>
Note that a
;See also:
* [http://www.numberphile.com/videos/vampire_numbers.html numberphile.com].
* [http://users.cybercity.dk/~dsl522332/math/vampires/
* [[oeis:A014575|
<br><br>
|