A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied:
If these conditions are met, x and y are known as "fangs" of v. For example, 1260 is a vampire number because 1260 = 21*60, so 21 and 60 are the fangs.
Write a function that returns all the vampire numbers in a given array. The output is a vector.
Example: disp(find_vampire(1000:2000) 1260 1395 1435 1530 1827
See also: Problem 1825. Find all vampire fangs and Problem 1804. Fangs of a vampire number.
Since I created the problem series and want the Functions I badge, I thought I'd provide the solution that incorporates vampire_factor and are_fangs. Not a great score, but readable!
Sorry, I mean the Magic Numbers badge.
Like it
Determine if a Given Number is a Triangle Number
286 Solvers
Similar Triangles - find the height of the tree
154 Solvers
Create a Multiplication table matrix...
222 Solvers
157 Solvers
373 Solvers