login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014575 Vampire numbers (definition 2): numbers n with an even number of digits which have a factorization n = i*j where i and j have the same number of digits and the multiset of the digits of n coincides with the multiset of the digits of i and j. 18

%I #75 Mar 25 2023 16:33:23

%S 1260,1395,1435,1530,1827,2187,6880,102510,104260,105210,105264,

%T 105750,108135,110758,115672,116725,117067,118440,120600,123354,

%U 124483,125248,125433,125460,125500,126027,126846,129640

%N Vampire numbers (definition 2): numbers n with an even number of digits which have a factorization n = i*j where i and j have the same number of digits and the multiset of the digits of n coincides with the multiset of the digits of i and j.

%C 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]

%D C. A. Pickover, "Vampire Numbers." Ch. 30 in Keys to Infinity. New York: Wiley, pp. 227-231, 1995.

%H Giovanni Resta, <a href="/A014575/b014575.txt">Table of n, a(n) for n = 1..10000</a> (terms a(1)-a(87) by R. J. Mathar and a(88)-a(1006) by Manfred Scheucher)

%H Ely Golden, <a href="/A014575/a014575.py.txt">Sympy program for generating vampire numbers (definition 2)</a>

%H Manfred Scheucher, <a href="/A014575/a014575.sage.txt">Sage Script</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/VampireNumber.html">Vampire Number</a>

%e 1260 = 21*60, 1395 = 15*93, 1435 = 35*41, 1530 = 30*51, etc.

%p n := 1 :

%p for dgs from 4 to 10 by 2 do

%p for a from 10^(dgs-1) to 10^dgs-1 do

%p amset := sort(convert(a,base,10)) ;

%p isv := false ;

%p for d in numtheory[divisors](a) do

%p m := a/d ;

%p if ( m >= d ) then

%p dset := convert(d,base,10) ;

%p mset := convert(m,base,10) ;

%p fset := sort([op(dset),op(mset)]) ;

%p if fset = amset and nops(dset) = nops(mset) then

%p if (m mod 10 <> 0 ) or (d mod 10 <> 0 ) then

%p printf("%d %d\n",n,a) ;

%p isv := true ;

%p n := n+1 ;

%p end if;

%p end if;

%p end if;

%p if isv then

%p break;

%p end if;

%p end do:

%p end do:

%p end do: # _R. J. Mathar_, Jan 10 2013

%t 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 *)

%o (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

%o (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

%Y The following sequences are all closely related: A020342, A014575, A080718, A280928, A048936, A144563.

%Y Cf. A048933, A048934, A048935, A048936, A048937, A048938, A048939.

%K nonn,base

%O 1,1

%A _Eric W. Weisstein_

%E Edited by _N. J. A. Sloane_, Jan 03 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 04:48 EDT 2024. Contains 372178 sequences. (Running on oeis4.)