login
A382055
a(n) = least positive integer m such that when m*(m+1) is written in base n, it does not contain the digits 0 or n-1 and contains every single digit from 1 to n-2 exactly once, or 0 if no such number exists.
1
0, 2, 6, 19, 0, 420, 924, 3672, 0, 78880, 431493, 2173950, 0, 71583429, 436726936, 2750336517, 0, 120521201887, 833996387274, 5932255141224, 0, 324116744376715, 2483526997445916, 19463766853506024, 0, 1274294107710603710, 10627079743009611713, 90335862784009245081, 0
OFFSET
3,2
FORMULA
a(n) = 0 if n == 3 (mod 4). For a proof of this see A382054 for the proof of a similar result which also holds in this case.
Conjecture: a(n) = 0 if and only if n == 3 (mod 4).
EXAMPLE
a(9) = 924. 924*925 = 854700 which is 1542376 in base 9.
PROG
(Python)
from itertools import count
from math import isqrt
from sympy.ntheory import digits
def A382055(n):
k, l, d= (n*(n-1)>>1)%(n-1), (-n**(n - 1) + (n - 1)**2*(n**(n - 2)*(1 - n) + n**(n - 1)) + 1)//(n - 1)**2, tuple(range(1, n-1))
clist = [i for i in range(n-1) if i*(i+1)%(n-1)==k]
if len(clist) == 0:
return 0
s = (-n**2 + n + n**n - (n - 1)**3 - 1)//(n*(n - 1)**2)
s = isqrt((s<<2)+1)-1>>1
s += n-1-s%(n-1)
if s%(n-1) <= max(clist):
s -= n-1
for a in count(s, n-1):
if a*(a+1)>l:
break
for c in clist:
m = a+c
if m*(m+1)>l:
break
if tuple(sorted(digits(m*(m+1), n)[1:]))==d:
return m
return 0 # Chai Wah Wu, Mar 17 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Mar 13 2025
STATUS
approved