login
A393198
a(n) is the least value of m such that n has a prime number of ones in its base m expansion.
2
2, 3, 2, 2, 2, 7, 2, 2, 2, 2, 2, 2, 14, 3, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 26, 2, 4, 3, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 6, 3, 2, 2, 2, 2, 50, 2, 4, 53, 2, 2, 7, 3, 2, 7, 2, 2, 62, 3, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 8, 2, 4, 7, 2, 2, 2, 2, 4, 2, 3, 3, 2, 2, 4, 3, 2, 3, 2, 2, 3, 2, 2, 2, 98, 2
OFFSET
3,1
COMMENTS
a(n) <= n-1 since n in base n-1 is 11, which has two ones, and 2 is prime.
LINKS
EXAMPLE
The expression of n=16 in base 2 is 10000, which has one 1; its expression in base 3 is 121, which has two ones, and 2 is prime. So a(16)=3.
MATHEMATICA
Table[First@Select[Range[2, n], PrimeQ[Count[IntegerDigits[n, #], 1]] &], {n, 3, 100}]
PROG
(PARI) a(n) = my(m=2); while (!isprime(#select(x->(x==1), digits(n, m))), m++); m; \\ Michel Marcus, Feb 07 2026
(Python)
from itertools import count
from sympy.ntheory.factor_ import isprime, digits
def A393198(n): return next(m for m in count(2) if isprime(digits(n, m).count('1'))) # Chai Wah Wu, Feb 19 2026
CROSSREFS
Sequence in context: A077199 A145390 A270026 * A340703 A128049 A104543
KEYWORD
nonn,base
AUTHOR
STATUS
approved