OFFSET
2,2
COMMENTS
Zeroless pandigital numbers may or may not contain the digit 0. In this sense, both 1023456789 and 123456789 are regarded as pandigital numbers in base 10.
a(13) is the first element greater than n^(n-1), i.e., its base-n representation is not a permutation of the numbers from 1 to n-1.
It is yet to be shown that this sequence has no end, i.e., there may be an n such that a(n) does not exist.
There may be a number n such that a(n) = a(n-1).
This sequence can be considered a version of A055085 where leading zeros are taken into account.
A055085 uses a similar definition, requiring that the digit 0 appear in all representations in order to consider the number pandigital.
EXAMPLE
For n = 2, 1 is the smallest base-2 pandigital number.
For n = 3, 5 is the smallest base-3 pandigital number (12) that is also base-2 pandigital (101).
For n = 4, 45 is the smallest base-4 pandigital number (231) that is also base-3 pandigital (1200) and base-2 pandigital (101101).
PROG
(PARI) isok(i, n) = {for (b = 2, n, if (Set(digits(i, b))[1] && #Set(digits(i, b)) != b - 1, return (0)); if (Set(digits(i, b))[1] == 0 && #Set(digits(i, b)) != b, return(0)); ); return (1)}
a(n) = {i = n^(n-2); while (! isok(i, n), i++); i; }
(Python)
from itertools import count, product
from sympy.utilities.iterables import multiset_permutations
from gmpy2 import digits, mpz
def A351426(n): # assumes n <= 62
if n == 2:
return 1
dlist = tuple(digits(d, n) for d in range(n))
for l in count(n-2):
for d in range(1, n):
c = None
for t in product(dlist, repeat=l-n+2):
for u in multiset_permutations(sorted(t+dlist[1:d]+dlist[d+1:])):
m = mpz(''.join((dlist[d], )+tuple(u)), n)
for b in range(n-1, 1, -1):
if len(set(digits(m, b))|{'0'}) < b:
break
else:
if c != None:
c = min(m, c)
else:
c = m
if c != None:
return int(c) # Chai Wah Wu, Mar 14 2022
CROSSREFS
KEYWORD
base,more,nonn
AUTHOR
Fernando Solanet Mayou, Feb 11 2022
EXTENSIONS
a(14) corrected by Fernando Solanet Mayou, Apr 08 2022
a(15) from Fernando Solanet Mayou, Jun 28 2022
STATUS
approved
