OFFSET
0,1
LINKS
Andrew M. Johnson, Table of n, a(n) for n = 0..49999
EXAMPLE
For n = 9:
- the sum of digits of 9 is distinct to that of 0, 1, 2, 4, 7, 8 in base 2,
- the sum of digits of 9 equals that of 5 and 6 in base 2, but is distinct in base 3,
- the sum of digits of 9 equals that of 3 in bases 2, 3 and 4, but is distinct in base 5,
- hence a(9) = 5.
PROG
(PARI) a(n) = { my (v=2); for (k=1, n-1, for (p=2, oo, if (sumdigits(n, p)!=sumdigits(k, p), v=max(v, p); break))); return (v) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 21 2019
STATUS
approved