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, Table of n, a(n) for n = 3..388
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
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Apr 10 2024
STATUS
approved