OFFSET
1,4
COMMENTS
It is known that this sequence is bounded by a constant.
It appears that a(37) = 12 is the largest value to occur, a(83) = a(161) = 11 the second largest value(s), and for n > 299, all a(n) < 10. The values 7, 8, 9, 10 seem to occur for the last time at indices n = 2563, 2267, 515, 299; at least this is true up to 10^6. - M. F. Hasler, Sep 06 2025
Note that this sequence counts as solution each (distinct) tuple (r,s,t,u), while some authors count only distinct "representations" or sets {2^r, 3^s, 2^t*3^u}. Then, when t or u is zero, s and u (resp. r and t) become interchangeable, cf. Example. - M. F. Hasler, Sep 08 2025
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..10000
P. Bajpai and M.A. Bennett, Effective S-unit Equations Beyond 3 Terms: Newman's Conjecture, Acta Arithmetica 214 (2024), 421-458, DOI:10.4064/aa230725-14-9; also arXiv:2308.05162.
Thomas Bloom, Problem 407, Erdős Problems.
J.-H. Evertse, K. Győry, C. L. Stewart, and R. Tijdeman, S-unit equations and their applications, New advances in transcendence theory (Durham, 1986) (1988), 138-140.
EXAMPLE
For n = 4 the solutions are (0,0,1,0) and (1,0,0,0).
For n = 10 the solutions are (0,0,3,0), (0,1,1,1), (2,1,0,1), and (3,0,0,0).
For n = 531458, the a(n) = 5 solutions ((0,12,4,0), (3,2,0,12), (3,12,0,2), (4,0,0,12), (4,12,0,0)) correspond to only 2 distinct representations 1 + 2^4 + 3^12 and 2^3 + 3^2 + 3^12.
MATHEMATICA
a[n_]:=Module[{p, q}, p=Ceiling[Log[2, n]]; q=Ceiling[Log[3, n]]; Sum[If[n==2^a+3^b+2^c*3^d, 1, 0], {a, 0, p}, {b, 0, q}, {c, 0, p}, {d, 0, q}]]; Table[a[n], {n, 1, 99}] (* James C. McMahon, Sep 14 2025 *)
PROG
(Python)
import math
def a(n):
p, q = math.ceil(math.log2(n)), math.ceil(math.log(n, 3))
return sum(1 for a in range(p+1) for b in range(q+1) for c in range(p+1) for d in range(q+1) if n == 2**a + 3**b + (2**c)*(3**d))
print([a(n) for n in range(1, 100)])
(PARI) A387688_upto(N)={my(A=[2^k|k<-[0..logint(N, 2)]], B=[3^k|k<-[0..logint(N, 3)]], S=vecsort(concat([[a+b|a<-A, a+b<N]|b<-B])), c=Vec(0, N)); foreach( vecsort(concat([[a*b|a<-A, a*b<N]|b<-B])), p, foreach(S, s, s+p>N && break; c[s+p]++)); c} \\ M. F. Hasler, Sep 06 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Leon Grigoruk, Sep 06 2025
STATUS
approved
