This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A014575 #84 Mar 14 2025 19:01:11 %S A014575 1260,1395,1435,1530,1827,2187,6880,102510,104260,105210,105264, %T A014575 105750,108135,110758,115672,116725,117067,118440,120600,123354, %U A014575 124483,125248,125433,125460,125500,126027,126846,129640 %N 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. %C A014575 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 A014575 C. A. Pickover, "Vampire Numbers." Ch. 30 in Keys to Infinity. New York: Wiley, pp. 227-231, 1995. %H A014575 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 A014575 Ely Golden, <a href="/A014575/a014575.py.txt">Sympy program for generating vampire numbers (definition 2)</a> %H A014575 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_20">Cab and Vampire Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 20, 499-512. %H A014575 Manfred Scheucher, <a href="/A014575/a014575.sage.txt">Sage Script</a> %H A014575 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/VampireNumber.html">Vampire Number</a> %e A014575 1260 = 21*60, 1395 = 15*93, 1435 = 35*41, 1530 = 30*51, etc. %p A014575 n := 1 : %p A014575 for dgs from 4 to 10 by 2 do %p A014575 for a from 10^(dgs-1) to 10^dgs-1 do %p A014575 amset := sort(convert(a,base,10)) ; %p A014575 isv := false ; %p A014575 for d in numtheory[divisors](a) do %p A014575 m := a/d ; %p A014575 if ( m >= d ) then %p A014575 dset := convert(d,base,10) ; %p A014575 mset := convert(m,base,10) ; %p A014575 fset := sort([op(dset),op(mset)]) ; %p A014575 if fset = amset and nops(dset) = nops(mset) then %p A014575 if (m mod 10 <> 0 ) or (d mod 10 <> 0 ) then %p A014575 printf("%d %d\n",n,a) ; %p A014575 isv := true ; %p A014575 n := n+1 ; %p A014575 end if; %p A014575 end if; %p A014575 end if; %p A014575 if isv then %p A014575 break; %p A014575 end if; %p A014575 end do: %p A014575 end do: %p A014575 end do: # _R. J. Mathar_, Jan 10 2013 %t A014575 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 A014575 (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 A014575 (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 A014575 The following sequences are all closely related: A020342, A014575, A080718, A280928, A048936, A144563. %Y A014575 Cf. A048933, A048934, A048935, A048936, A048937, A048938, A048939. %K A014575 nonn,base %O A014575 1,1 %A A014575 _Eric W. Weisstein_ %E A014575 Edited by _N. J. A. Sloane_, Jan 03 2009