login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A371194
a(n) = smallest penholodigital prime in base n.
4
3, 5, 103, 823, 10061, 157427, 2439991, 49100173, 1123465789, 31148488997, 816695154683, 25401384476191, 859466293047623, 33373273595699879, 1234907033823334111, 51892599148660469993, 2322058300483667372689, 115713970660820468376569, 5533344265927977839343539
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, 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
Sequence in context: A364549 A103081 A338269 * A346710 A234600 A003112
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Mar 14 2024
STATUS
approved