login
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.
1
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,1
FORMULA
T(n, 0) = 2.
T(n, k) <= n+1.
EXAMPLE
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
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 *)
PROG
(PARI) T(n, k) = { for (b = 2, oo, my (d = sumdigits(n, b) - sumdigits(k, b)); if (d, return (b); ); ); }
CROSSREFS
Cf. A374381.
Sequence in context: A163105 A152235 A278966 * A123582 A214861 A037914
KEYWORD
nonn,base,tabl
AUTHOR
Rémy Sigrist, Jul 07 2024
STATUS
approved