A374383 Triangle T(n, k), n > 0, k = 0..n-1, read by rows; T(n, k) is the least base b >= 2 where n and k have different sums of digits.
2, 2, 3, 2, 2, 2, 2, 3, 4, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 5, 2, 3, 3, 2, 2, 2, 2, 2, 3, 2, 3, 4, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 3, 2, 3, 5, 2, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 4, 2
Offset: 1
Examples
Triangle T(n, k) begins: n n-th row -- ---------------------------------- 1 2 2 2, 3 3 2, 2, 2 4 2, 3, 4, 2 5 2, 2, 2, 3, 2 6 2, 2, 2, 3, 2, 3 7 2, 2, 2, 2, 2, 2, 2 8 2, 3, 3, 2, 3, 2, 2, 2 9 2, 2, 2, 5, 2, 3, 3, 2, 2 10 2, 2, 2, 3, 2, 3, 4, 2, 2, 3 11 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2 12 2, 2, 2, 3, 2, 3, 5, 2, 2, 3, 4, 2
Crossrefs
Cf. A374381.
Programs
-
Mathematica
T[n_,k_]:=Module[{b=2},While[DigitSum[n,b]==DigitSum[k,b], b++]; b]; Table[T[n,k],{n,13},{k,0,n-1}]//Flatten (* Stefano Spezia, Jul 12 2024 *)
-
PARI
T(n, k) = { for (b = 2, oo, my (d = sumdigits(n, b) - sumdigits(k, b)); if (d, return (b););); }
Formula
T(n, 0) = 2.
T(n, k) <= n+1.