login
Triangle read by rows: for 1 <= k <= n, T(n,k) is the least sum of decimal digits of numbers with n binary digits and binary weight k.
2

%I #34 Jun 03 2024 18:20:18

%S 1,2,3,4,5,7,8,1,2,6,7,2,3,3,4,5,4,5,6,7,9,10,8,1,2,2,3,10,11,4,2,3,4,

%T 5,7,12,13,5,4,3,4,5,6,6,7,8,7,8,6,7,1,2,3,4,6,7,5,4,2,3,2,3,3,4,6,13,

%U 14,6,5,3,4,4,3,4,6,7,8,18,19,5,6,6,5,6,6,6,7,8,9,14,19,20,7,8,5

%N Triangle read by rows: for 1 <= k <= n, T(n,k) is the least sum of decimal digits of numbers with n binary digits and binary weight k.

%H Robert Israel, <a href="/A371470/b371470.txt">Table of n, a(n) for n = 1..325</a> (rows 1 to 25, flattened)

%F a(n) = A007953(A373289(n)).

%F T(A123384(i),A118738(i)) = 1.

%e T(5,3) = 3 because the numbers with 5 binary digits of which 3 are 1 are 19, 21, 22, 25, 26 and 28, and the least sum of decimal digits of these is 3 (for 21).

%e Triangle starts:

%e 1;

%e 2, 3;

%e 4, 5, 7;

%e 8, 1, 2, 6;

%e 7, 2, 3, 3, 4;

%e 5, 4, 5, 6, 7, 9;

%p M:= proc(n,k) local i,R,m,r,v;

%p R:= ListTools:-Reverse(map(t -> 2^(n-1)+add(2^(n-1-t[i]),i=1..k-1), combinat:-choose(n-1,k-1 )));

%p m:= infinity;

%p for r in R do

%p v:= convert(convert(r,base,10),`+`);

%p if v < m then m:= v fi;

%p od;

%p m

%p end proc:

%p for n from 1 to 12 do

%p seq(M(n,k),k=1..n)

%p od;

%Y Cf. A000120, A007953, A118738, A123384, A373289.

%K nonn,base,tabl

%O 1,2

%A _Robert Israel_, May 31 2024