login
Number of terms of 2^j + 3^k <= 10^n.
2

%I #18 Jul 30 2021 08:44:57

%S 7,29,64,118,181,254,354,453,565,708,878,1033,1224,1403,1594,1828,

%T 2046,2274,2553,2808,3139,3467,3765,4073,4443,4779,5124,5537,5911,

%U 6294,6690,7266,7693,8129,8650,9114,9588,10153,10654,11167,11776,12449,13005,13662,14243

%N Number of terms of 2^j + 3^k <= 10^n.

%C As n-> infinity, a(n) -> log_2(n)*log_3(n).

%H Zak Seidov, <a href="/A219835/b219835.txt">Table of n, a(n) for n = 1..1000</a>

%t Join[{7, 29}, Table[m = 10^x; -4 + Floor [ Log[3, m ]] + Sum[Floor @ Log[2, m - 3^i], {i, 0, Log[3, m]}], {x, 3, 100}]]

%o (Python)

%o def a(n):

%o s, pow3, lim = set(), 1, 10**n

%o while pow3 < lim:

%o for j in range((lim-pow3).bit_length()):

%o s.add(2**j + pow3)

%o pow3 *= 3

%o return len(s)

%o print([a(n) for n in range(1, 46)]) # _Michael S. Branicky_, Jul 29 2021

%Y Cf. A004050 (numbers of the form 2^j + 3^k).

%K nonn

%O 1,1

%A _Zak Seidov_, Nov 29 2012