OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..325 (rows 1 to 25, flattened)
EXAMPLE
T(5,3) = 21 because 21 = 10101_2 has 5 binary digits of which 3 are 1, and it has a lower sum of decimal digits, 3, than the other numbers (19, 22, 25, 26 and 28) with 5 binary digits of which 3 are 1.
Triangle starts
1;
2, 3;
4, 5, 7;
8, 10, 11, 15;
16, 20, 21, 30, 31;
32, 40, 41, 51, 61, 63;
MAPLE
M:= proc(n, k) local i, R, m, b, r, v;
R:= ListTools:-Reverse(map(t -> 2^(n-1)+add(2^(n-1-t[i]), i=1..k-1), combinat:-choose(n-1, k-1 )));
m:= infinity;
for r in R do
v:= convert(convert(r, base, 10), `+`);
if v < m then b:= r; m:= v fi;
od;
b
end proc:
for n from 1 to 12 do
seq(M(n, k), k=1..n)
od;
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, May 30 2024
STATUS
approved