This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A371512 #11 Apr 13 2024 23:17:42 %S A371512 13,37,163,1861,22481,304949,5455573,112345687,2831681057,68057976031, %T A371512 1953952652167,61390449569437,2224884906436873,77181689614101181, %U A371512 3052505832274232281,129003238915759600789,6090208982148446231753,276667213296398892309917,13944042713948404997174231 %N 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. %C A371512 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. %H A371512 Chai Wah Wu, <a href="/A371512/b371512.txt">Table of n, a(n) for n = 3..388</a> %H A371512 Chai Wah Wu, <a href="https://arxiv.org/abs/2403.20304">Pandigital and penholodigital numbers</a>, arXiv:2403.20304 [math.GM], 2024. %F A371512 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) . %e A371512 The corresponding base-n representations are: %e A371512 n a(n) in base n %e A371512 ------------------------ %e A371512 3 111 %e A371512 4 211 %e A371512 5 1123 %e A371512 6 12341 %e A371512 7 122354 %e A371512 8 1123465 %e A371512 9 11234567 %e A371512 10 112345687 %e A371512 11 1223456987 %e A371512 12 1123458a967 %e A371512 13 112345678ba9 %e A371512 14 11234567a8bc9 %e A371512 15 122345678acb9d %e A371512 16 1123456789ceabd %o A371512 (Python) %o A371512 from math import gcd %o A371512 from sympy import nextprime %o A371512 from sympy.ntheory import digits %o A371512 def A371512(n): %o A371512 m, j = 1, 0 %o A371512 if n > 3: %o A371512 for j in range(1,n-1): %o A371512 if gcd((n*(n-1)>>1)+j,n-1) == 1: %o A371512 break %o A371512 if j == 0: %o A371512 for i in range(2,n-1): %o A371512 m = n*m+i %o A371512 elif j == 1: %o A371512 for i in range(1,n-1): %o A371512 m = n*m+i %o A371512 else: %o A371512 for i in range(2,1+j): %o A371512 m = n*m+i %o A371512 for i in range(j,n-1): %o A371512 m = n*m+i %o A371512 m -= 1 %o A371512 while True: %o A371512 s = digits(m:=nextprime(m), n)[1:] %o A371512 if (not (0 in s or n-1 in s)) and len(set(s))==n-2: %o A371512 return m %Y A371512 Cf. A185122, A371194. %K A371512 nonn,base %O A371512 3,1 %A A371512 _Chai Wah Wu_, Apr 10 2024