09-29-2009 05:40 AM
Vampire numbers are the numbers (with even number of digits) that can be expressed as the product of the digits in the numbers itself.
For example : 1260 is a vampire number. It can be expressed as a product of 21 and 60 . 21 and 60 are called FANGS
Here is a code which i have developed which is able to find the vampire numbers (4 digits ony) along with there fangs
(This was a challenge given to me By BALAJI. Where are you Balaji?????????????? M waiting for my kudos and some good discussion)
09-29-2009 06:08 AM
I executed your code and find, the highest 4 digit Vampire number as per your code is 6880 and is appearing two times. (86 and 80, 80 and 86. Then again 86 and 80, 80 and 86 which is not required)
Mathan
09-29-2009 06:12 AM
Hi mathan 🙂 🙂
Ya, you are right. it displays the number two times and that can be certainly filtered out
09-29-2009 06:16 AM - edited 09-29-2009 06:21 AM
Vampire Numbers was a coding challenge.
The request
The result
How would it work with LV 2009, parallel loops on multicore CPU? Altenbach I think you have the code on hands. What about a retest?
09-29-2009 06:26 AM
09-29-2009 06:30 AM
Somil wrote:
It was given to me as a challenge by BALAJI to test my skills as i am a beginner in labVIEW![]()
Here is the link he is referring to.
09-29-2009 06:35 AM
09-29-2009 07:06 AM
09-29-2009 09:55 AM
waldemar.hersacher wrote:How would it work with LV 2009, parallel loops on multicore CPU? Altenbach I think you have the code on hands. What about a retest?
Yes, I still have all my code. Unfortunately I am pretty busy at the moment.
Somil,
This is certainly a good learning tool, but your code needs a significant makeover.
You should make the VI compatible with the template of the challenge.
Why don't you do a banchmark. This should literally take only microseconds with better code. 😉 (My code was able to get all vampire numbers (thousands!) with up to 8 digits in a faster time.)
09-29-2009 10:06 PM
Hi Altenbach
So this time, the Knight of NI and the winner of the same contest is helping me with his valuable suggestions.
Thanks a lot and i will certainly go for all the makeovers.
I have one query. how can i make an array of numbers (only for the true case) in the code attached!!!