login
A394373
a(n) is the least integer that is a vampire number in base n (see A014575 for base 10).
2
575, 320, 108, 192, 312, 432, 680, 1008, 1260, 1972, 2100, 2772, 3100, 4140, 4752, 7280, 6368, 24592, 9020, 10752, 11880, 13140, 15288, 18304, 19229, 21456, 23940, 26460, 29280, 196272, 35360, 37680, 41454, 49280, 49932, 271188, 58520, 64428, 68040, 77700, 78540, 82708, 90068, 97920
OFFSET
2,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 2..348
PROG
(PARI) isv(n, b)=my(v=digits(n, b)); if(#v%2, return(0)); fordiv(n, d, if(#digits(d, b)==#v/2 && #digits(n/d, b)==#v/2 && vecsort(v)==vecsort(concat(digits(d, b), digits(n/d, b))) && (d%b || (n/d)%b), return(1))); 0;
a(n) = my(k=1); while (!isv(k, n), k++); k;
(Python)
from itertools import count
from sympy import divisors
from sympy.ntheory.factor_ import digits
def is_vampire(n, base):
s = sorted(digits(n, base)[1:])
if len(s)&1: return False
divs, L, U = divisors(n), base**((len(s)//2)-1), base**(len(s)//2)
for i in range((len(divs)+1)//2+1):
x, y = divs[i], divs[-1-i]
if L <= x < U and L <= y < U and (x%base or y%base):
t, u = digits(x, base)[1:], digits(y, base)[1:]
if len(t) == len(u) and sorted(t+u) == s:
return True
return False
def a(n):
for d in count(2, 2):
v = next((k for k in range(n**(d-1), n**d) if is_vampire(k, n)), None)
if v: return v
print([a(n) for n in range(2, 46)]) # Michael S. Branicky, Jun 12 2026
CROSSREFS
Cf. A014575 (base 10), A392325 (base 12).
Sequence in context: A321052 A369625 A291133 * A027456 A158372 A230353
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Jun 12 2026
STATUS
approved