OFFSET
1,1
COMMENTS
The numbers i and j may not both have trailing zeros. Numbers may have more than one such factorization. However, each n is listed only once. [Comment modified by Rick L. Shepherd, Nov 02 2009]
REFERENCES
C. A. Pickover, "Vampire Numbers." Ch. 30 in Keys to Infinity. New York: Wiley, pp. 227-231, 1995.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000 (terms a(1)-a(87) by R. J. Mathar and a(88)-a(1006) by Manfred Scheucher)
Manfred Scheucher, Sage Script
Eric Weisstein's World of Mathematics, Vampire Number
EXAMPLE
1260 = 21*60, 1395 = 15*93, 1435 = 35*41, 1530 = 30*51, etc.
MAPLE
n := 1 :
for dgs from 4 to 10 by 2 do
for a from 10^(dgs-1) to 10^dgs-1 do
amset := sort(convert(a, base, 10)) ;
isv := false ;
for d in numtheory[divisors](a) do
m := a/d ;
if ( m >= d ) then
dset := convert(d, base, 10) ;
mset := convert(m, base, 10) ;
fset := sort([op(dset), op(mset)]) ;
if fset = amset and nops(dset) = nops(mset) then
if (m mod 10 <> 0 ) or (d mod 10 <> 0 ) then
printf("%d %d\n", n, a) ;
isv := true ;
n := n+1 ;
end if;
end if;
end if;
if isv then
break;
end if;
end do:
end do:
end do: # R. J. Mathar, Jan 10 2013
MATHEMATICA
fQ[n_] := If[OddQ@ IntegerLength@ n, False, MemberQ[Map[Sort@ Flatten@ IntegerDigits@ # &, Select[Map[{#, n/#} &, TakeWhile[Divisors@ n, # <= Sqrt@ n &]], SameQ @@ Map[IntegerLength, #] &]], Sort@ IntegerDigits@ n]]; Select[Range[10^6], fQ] (* Michael De Vlieger, Jan 27 2017 *)
PROG
(PARI) is(n)=my(v=digits(n)); if(#v%2, return(0)); fordiv(n, d, if(#Str(d)==#v/2 && #Str(n/d)==#v/2 && vecsort(v)==vecsort(digits(eval(Str(d, n/d)))) && (d%10 || (n/d)%10), return(1))); 0 \\ Charles R Greathouse IV, Apr 19 2013
(PARI) is_A014575(n)={my(v=vecsort(Vecsmall(Str(n)))); #v%2 && return; my( M=10^(#v\2), L=M\10); fordiv(n, d, d<L && next; d<M || return; v==vecsort(Vecsmall(Str(d, n/d))) && return(d))} \\ Twice as fast. Returns smallest factor (A048933) if vampire number, or false (empty, 0) else. - M. F. Hasler, Mar 11 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Jan 03 2009
STATUS
approved