%I #17 Mar 05 2026 19:43:35
%S 2,3,2,3,3,2,2,3,2,2,2,2,2,5,2,3,3,2,2,3,2,3,3,3,3,3,2,2,2,2,2,3,3,3,
%T 3,2,2,5,2,3,3,4,4,3,2,2,2,3,3,3,4,3,3,2,2,4,2,2,2,2,2,4,2,3,3,3,3,3,
%U 3,3,3,3,3,3,4,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,2,2,2,2,2,3,3,3,2,3,3,2,2,3,4
%N Greatest integer b such that the sum of the integer digits of n in bases 2..b strictly increases.
%C Even if we interpret A000042 as base 1, it cannot be incorporated into this sequence, since the count of ones in A000042 would always exceed the count of ones in base 2.
%H Robert Israel, <a href="/A393591/b393591.txt">Table of n, a(n) for n = 1..10000</a>
%e For the examples, define f(n, b) as the sum of the digits in the representation of n in base b.
%e a(1) is 2 because f(1, 3) is not larger than f(1, 2);
%e a(2) is 3 because f(2, 2) is less than f(2, 3) but f(2, 3) is not less than f(2, 4);
%e a(14) is 5 because f(14, 2) < f(14, 3) < f(14, 4) < f(14, 5) but f(14, 5) is not less than f(14, 6), etc.
%p f:= proc(n) local b,s,sb;
%p s:= convert(convert(n,base,2),`+`);
%p for b from 3 do
%p sb:= convert(convert(n,base,b),`+`);
%p if sb <= s then return b-1 fi;
%p s:= sb
%p od;
%p end proc:
%p map(f, [$1..200]); # _Robert Israel_, Feb 22 2026
%t a[n_] := Block[{b = 3, c = Total[ IntegerDigits[n, 2]]}, While[d = Total[ IntegerDigits[n, b]]; c < d, c = d; b++]; b - 1]; Array[a, 105]
%o (PARI) isok(n, b)= my(v=vector(b-1, bb, sumdigits(n, bb+1))); v == Set(v);
%o a(n) = my(b=2); while (isok(n,b), b++); b-1; \\ _Michel Marcus_, Feb 27 2026
%Y Cf. A393592.
%K base,nonn
%O 1,1
%A _Robert G. Wilson v_, Feb 22 2026