[go: up one dir, main page]

login
A119353
Smallest value obtained by writing n in base b > 1 such that n in base b uses no digit b-1 and then interpreting this as a base b-1 number.
2
0, 1, 2, 2, 3, 4, 5, 6, 6, 4, 5, 9, 6, 7, 12, 12, 9, 10, 11, 16, 12, 13, 14, 20, 15, 16, 17, 8, 9, 25, 10, 11, 18, 19, 20, 24, 12, 13, 23, 14, 15, 25, 26, 31, 32, 33, 34, 42, 35, 36, 32, 33, 34, 35, 40, 36, 37, 38, 39, 45, 40, 41, 42, 43, 27, 28, 29, 46, 30, 31, 32, 55, 33, 34, 35
OFFSET
0,3
COMMENTS
The b that produces the smallest value is always the smallest b such that n in base b does not use b-1.
LINKS
EXAMPLE
10 = 101_3, 101_2 = 5, so a(10) = 5.
11 = 102_3, which has a 2; 11 = 23_4, which has a 3; 11 = 21_5, 21_4 = 9, so a(11) = 9.
PROG
(PARI) a(n) = for (b=3, oo, my (d=digits(n, b)); if (#d==0 || vecmax(d) < b-1, return (fromdigits(d, b-1)))) \\ Rémy Sigrist, May 07 2018
CROSSREFS
Cf. A119352.
Sequence in context: A329904 A331307 A331306 * A140859 A072586 A329548
KEYWORD
base,nonn
AUTHOR
STATUS
approved