OFFSET
0,4
COMMENTS
This sequence is unbounded (see also A356516).
FORMULA
a(2*n) = a(n).
EXAMPLE
For n = 87:
- we have:
b x_87(b) x_87(b) in base b+1
--- ------- -------------------
1 87 "1010111"
2 5 "12"
>=3 3 "3"
- so a(87) = 3.
PROG
(PARI) a(n) = { for (b=2, oo, if (n<b, return (n), n=sumdigits(n, b))) }
(Python)
from sympy.ntheory import digits
def a(n):
xn, b = n, 2
while xn >= b: xn = sum(digits(xn, b)[1:]); b += 1
return xn
print([a(n) for n in range(105)]) # Michael S. Branicky, Aug 10 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Aug 09 2022
STATUS
approved