OFFSET
2,1
COMMENTS
a(n) is the smallest prime whose base-n representation contains all digits (i.e., 0,1,...,n-1) at least once.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 2..386 (terms 2..100 from Per H. Lundow)
Chai Wah Wu, Pandigital and penholodigital numbers, arXiv:2403.20304 [math.GM], 2024. See p. 3.
EXAMPLE
The corresponding base-b representations are:
2 10
3 102
4 10123
5 101234
6 1013425
7 10223465
8 101234567
9 1012346785
10 10123457689
11 1022345689a7
12 101234568a79b
13 10123456789abc
14 10123456789cdab
15 10223456789adbce
...
PROG
(Python)
from math import gcd
from itertools import count
from sympy import nextprime
from sympy.ntheory import digits
def A185122(n):
m = n
j = 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:
if len(set(digits(m:=nextprime(m), n)[1:]))==n:
return m # Chai Wah Wu, Mar 12 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Per H. Lundow, Jan 16 2012
STATUS
approved