%I #13 Nov 28 2021 13:35:28
%S 2,2,3,2,4,3,3,2,3,5,4,4,5,5,3,2,4,3,5,5,3,4,4,3,4,3,3,3,3,4,3,2,6,4,
%T 4,4,6,6,6,5,5,5,4,4,5,5,3,3,6,5,6,4,4,3,5,6,5,6,6,6,4,4,3,2,5,6,5,5,
%U 3,4,5,5,6,6,5,6,6,6,3,3,3,3,5,5,4,4,4
%N a(n) is the least base >= 2 such that for any k in the range 0..n-1, the sum of digits of k and the sum of digits of n differ for at least one base b in the range 2..a(n).
%H Andrew M. Johnson, <a href="/A327664/b327664.txt">Table of n, a(n) for n = 0..49999</a>
%F a(n) = 2 iff n belongs to A000225.
%F a(n) <= A327667(n).
%e For n = 9:
%e - the sum of digits of 9 is distinct to that of 0, 1, 2, 4, 7, 8 in base 2,
%e - the sum of digits of 9 equals that of 5 and 6 in base 2, but is distinct in base 3,
%e - the sum of digits of 9 equals that of 3 in bases 2, 3 and 4, but is distinct in base 5,
%e - hence a(9) = 5.
%o (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) }
%Y Cf. A000225, A327667.
%K nonn,base
%O 0,1
%A _Rémy Sigrist_, Sep 21 2019
|