Test if a given number is a Vampire Number

Python - 188 chars

Doesn't do Pseudovampire numbers

from itertools import*
n=input()
a=[]
for i in map("".join,permutations(`n`)):x,y=int(i[::2]),int(i[::-2]);a+=[(x,y)]*(x*y==n)
print n,a and"=%s*%s"%min(a)or"is not a Vampire Number"

Ruby, 190 chars

o=[]
[*x.chars].permutation{|r|a=r.pop(x.size/2).join.to_i
r=r.join.to_i
o|=[[a,r]]if a<=r&&a*r==x.to_i}
puts x+(o.any? ? o.map{|i|" = "+i*" * "}*"":" is not a Vampire Number.")

Tags:

Math

Code Golf