OFFSET
2,1
COMMENTS
a(n) is the smallest prime whose base-n representation is zeroless and contains all nonzero digits (i.e., 1,...,n-1) at least once.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 2..387
Chai Wah Wu, Pandigital and penholodigital numbers, arXiv:2403.20304 [math.GM], 2024. See p. 3.
FORMULA
a(n) >= A023811(n).
EXAMPLE
The corresponding base-n representations are:
n a(n) in base n
------------------------
2 11
3 12
4 1213
5 11243
6 114325
7 1223654
8 11235467
9 112345687
10 1123465789
11 1223456789a
12 11234567a98b
13 112345678abc9
14 112345678cadb9
15 1223456789adcbe
16 1123456789abcedf
17 1123456789abdgfec
18 1123456789abcehfgd
19 1223456789abcdefghi
20 1123456789abcdefhigj
21 1123456789abcdefgihjk
22 1123456789abcdefgjhikl
23 1223456789abcdefghjimlk
24 1123456789abcdefghkmijln
25 1123456789abcdefghijklnom
26 1123456789abcdefghijkmnpol
27 1223456789abcdefghijklmqnop
28 1123456789abcdefghijklmnqorp
29 1123456789abcdefghijklmnrqspo
30 1123456789abcdefghijklmnosqprt
31 1223456789abcdefghijklmnoptusrq
32 1123456789abcdefghijklmnopqrvust
33 1123456789abcdefghijklmnopqsrtuvw
34 1123456789abcdefghijklmnopqrstuxwv
35 1223456789abcdefghijklmnopqrstuxwvy
36 1123456789abcdefghijklmnopqrstuwzyxv
PROG
(Python)
from math import gcd
from sympy import nextprime
from sympy.ntheory import digits
def A371194(n):
m, j = 1, 0
if n > 3:
for j in range(1, n):
if gcd((n*(n-1)>>1)+j, n-1) == 1:
break
if j == 0:
for i in range(2, n):
m = n*m+i
elif j == 1:
for i in range(1, n):
m = n*m+i
else:
for i in range(2, 1+j):
m = n*m+i
for i in range(j, n):
m = n*m+i
m -= 1
while True:
s = digits(m:=nextprime(m), n)[1:]
if 0 not in s and len(set(s))==n-1:
return m
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Mar 14 2024
STATUS
approved