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
Sean A. Irvine, Table of n, a(n) for n = 3..1000
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
KEYWORD
nonn,base
AUTHOR
Diego Artacho and Andreas Vermeiren, Feb 05 2026
STATUS
approved
