login
The smallest positive number k such that the sum of the products of its digits when written in all bases 2 to n equals k, or -1 if no such number exists.
0

%I #11 Oct 16 2024 09:24:30

%S 1,2,-1,-1,9,48,25,118,86,72,72,258,708,308,396,273,6766,3386,1824,

%T 4488,4488,14061,14061,18270,8451,8451,570519,29502,203294,3628711,

%U 245007,361756,647656,49576,802652,1939745,420425,1790440,1790440,2174442,2801270,2673114,4094198,7522494,4226417,45177234,10348312,7157442,1601866,6496434,7522933,29818414

%N The smallest positive number k such that the sum of the products of its digits when written in all bases 2 to n equals k, or -1 if no such number exists.

%C For n = 3 to 54 there are no terms 1 less than a power of 2, so the base 2 product does not contribute to the sum for any of these terms. In the same range the base 3 product only contributes for n = 8, while the base 4 product contributes for n = 6, 8, 9, 10, 18, 23, 24, 31, 42.

%e a(6) = 9 as 9 = 1001_2 = 100_3 = 21_4 = 14_5 = 13_6, and the sum of the products of the digits in each base is 0 + 0 + 2 + 4 + 3 = 9.

%e a(10) = 86 as 86 = 1010110_2 = 10012_3 = 1112_4 = 321_5 = 222_6 = 152_7 = 126_8 = 105_9 = 86_10, and the sum of the products of the digits in each base is 0 + 0 + 2 + 6 + 8 + 10 + 12 + 0 + 48 = 86.

%Y Cf. A376816, A376817, A004209, A007953.

%K sign,base

%O 2,2

%A _Scott R. Shannon_, Oct 07 2024