OFFSET
3,1
COMMENTS
The sequence is well-defined, as the expression of n base n-1 is 11. Therefore a(n) <= n-1.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 3..10002
FORMULA
a(n) >= A393198(n).
EXAMPLE
a(14) = 3. The binary representation of 14 is 1110, which contains three ones, and its ternary representation is 112, which contains exactly two ones.
MATHEMATICA
Table[First@Select[Range[2, n], Count[IntegerDigits[n, #], 1] == 2 &], {n, 3, 100}]
PROG
(PARI) a(n) = my(m=2); while (#select(x->(x==1), digits(n, m)) != 2, m++); m; \\ Michel Marcus, Feb 13 2026
(Python)
from sympy.ntheory import digits
def a(n): return next(m for m in range(2, n) if digits(n, m)[1:].count(1) == 2)
print([a(n) for n in range(3, 85)]) # Michael S. Branicky, Feb 13 2026
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Andreas Vermeiren and Diego Artacho, Feb 05 2026
STATUS
approved
