login
A393591
Greatest integer b such that the sum of the integer digits of n in bases 2..b strictly increases.
2
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, 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, 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
OFFSET
1,1
COMMENTS
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.
LINKS
EXAMPLE
For the examples, define f(n, b) as the sum of the digits in the representation of n in base b.
a(1) is 2 because f(1, 3) is not larger than f(1, 2);
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);
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.
MAPLE
f:= proc(n) local b, s, sb;
s:= convert(convert(n, base, 2), `+`);
for b from 3 do
sb:= convert(convert(n, base, b), `+`);
if sb <= s then return b-1 fi;
s:= sb
od;
end proc:
map(f, [$1..200]); # Robert Israel, Feb 22 2026
MATHEMATICA
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]
PROG
(PARI) isok(n, b)= my(v=vector(b-1, bb, sumdigits(n, bb+1))); v == Set(v);
a(n) = my(b=2); while (isok(n, b), b++); b-1; \\ Michel Marcus, Feb 27 2026
CROSSREFS
Cf. A393592.
Sequence in context: A200323 A075370 A332297 * A030350 A026240 A124474
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Feb 22 2026
STATUS
approved