%I #27 Aug 09 2024 12:36:21
%S 1,2,3,-1,6,81,8,5,28,27,-1,20,7,30,2187,128,17,14,15,244,243,-1,68,
%T 25,46,31,246,-1,512,8193,26,23,94,63,6570,19683,-1,80,131,78,47,126,
%U 247,2430,59049,2048,1025,134,53,62,95,254,255,19926,531441,-1,2050,161,212,79,222,127,766,2431
%N Array read by antidiagonals: T(k,n) is the least positive integer whose sum of base-2 digits is k and sum of base-3 digits is n, or -1 if there is none.
%C T(k,n) is the least positive integer x, if it exists, such that A000120(x) = k and A053735(x) = n.
%C T(k,n) == n (mod 2) unless T(k,n) = -1, since A053735(x) == x (mod 2). In particular, T(1, n) = -1 if n >= 3 is odd.
%C Dimitrov and Howe prove that for n > 25, the sum of binary digits of 3^n is > 22. In particular, this implies T(7,1) = T(12,1) = T(21,1) = -1, since none of the first 25 powers of 3 work.
%H Robert Israel, <a href="/A375258/b375258.txt">Table of n, a(n) for n = 1..253</a> (first 22 antidiagonals)
%H Vassil S. Dimitrov and Everett W. Howe, <a href="https://arxiv.org/abs/2105.06440">Powers of 3 with few nonzero bits and a conjecture of Erdős</a>, arXiv:2105.06440 [math.NT], 2021.
%e Array starts
%e 1, 2, -1, 8, -1, 128, -1, 512, ...
%e 3, 6, 5, 20, 17, 68, 8193, 80, ...
%e 81, 28, 7, 14, 25, 26, 131, 134, ...
%e 27, 30, 15, 46, 23, 78, 53, 212, ...
%e 2187, 244, 31, 94, 47, 62, 79, 158, ...
%e 243, 246, 63, 126, 95, 222, 125, 238, ...
%e -1, 6570, 247, 254, 127, 382, 223, 446, ...
%e 19683, 2430, 255, 766, 507, 510, 383, 958, ...
%p T:= Matrix(8,8,-1):
%p for x from 1 to 10^5 do
%p k:= convert(convert(x,base,2),`+`);
%p n:= convert(convert(x,base,3),`+`);
%p if k <= 8 and n <= 8 and T[k,n] = -1 then T[k,n]:= x; fi
%p od:
%p T;
%Y Cf. A000120, A011754, A037301, A053735, A375257.
%K sign,base
%O 1,2
%A _Robert Israel_, Aug 07 2024