close
login
A393199
a(n) is the least m such that the base m expansion of n contains exactly two ones.
1
2, 3, 2, 2, 6, 7, 2, 2, 10, 2, 12, 3, 14, 3, 2, 2, 18, 2, 20, 3, 4, 2, 4, 5, 26, 3, 4, 3, 30, 3, 2, 2, 34, 2, 4, 3, 38, 2, 5, 3, 42, 3, 6, 3, 6, 2, 6, 3, 50, 3, 4, 53, 6, 5, 56, 3, 7, 7, 6, 7, 62, 3, 2, 2, 6, 2, 68, 3, 4, 2, 4, 8, 8, 3, 4, 7, 6, 2, 5, 3, 4, 3
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
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
Cf. A393198.
Sequence in context: A007653 A353623 A272181 * A154179 A300862 A151863
KEYWORD
nonn,base
AUTHOR
STATUS
approved