login
A371512
a(n) is the smallest prime such that its representation in base n contains each of the digits 1,...,n-2 at least once and does not contain the digit 0 nor the digit n-1.
1
13, 37, 163, 1861, 22481, 304949, 5455573, 112345687, 2831681057, 68057976031, 1953952652167, 61390449569437, 2224884906436873, 77181689614101181, 3052505832274232281, 129003238915759600789, 6090208982148446231753, 276667213296398892309917, 13944042713948404997174231
OFFSET
3,1
COMMENTS
Conjecture: for n>3, a(n) has digit sum 2+(n-2)(n-1)/2 if n is of the form 4k+3 and has digit sum 1+(n-2)(n-1)/2 otherwise.
LINKS
Chai Wah Wu, Pandigital and penholodigital numbers, arXiv:2403.20304 [math.GM], 2024.
FORMULA
For n>=3, a(n) >= (n^(n-1)-n)/(n-1)^2 + n^(n-2). If n = 4k+3 for k>0, then a(n) >= (n^(n-1)-n)/(n-1)^2 + n^(n-2) + n^(n-3) .
EXAMPLE
The corresponding base-n representations are:
n a(n) in base n
------------------------
3 111
4 211
5 1123
6 12341
7 122354
8 1123465
9 11234567
10 112345687
11 1223456987
12 1123458a967
13 112345678ba9
14 11234567a8bc9
15 122345678acb9d
16 1123456789ceabd
PROG
(Python)
from math import gcd
from sympy import nextprime
from sympy.ntheory import digits
def A371512(n):
m, j = 1, 0
if n > 3:
for j in range(1, n-1):
if gcd((n*(n-1)>>1)+j, n-1) == 1:
break
if j == 0:
for i in range(2, n-1):
m = n*m+i
elif j == 1:
for i in range(1, n-1):
m = n*m+i
else:
for i in range(2, 1+j):
m = n*m+i
for i in range(j, n-1):
m = n*m+i
m -= 1
while True:
s = digits(m:=nextprime(m), n)[1:]
if (not (0 in s or n-1 in s)) and len(set(s))==n-2:
return m
CROSSREFS
Sequence in context: A201480 A036570 A147615 * A298683 A173872 A155241
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Apr 10 2024
STATUS
approved