This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A336004 #31 Feb 18 2022 21:06:00 %S A336004 13,14,22,23,26,31,35,38,39,41,42,43,44,45,46,47,50,51,52,53,58,59,62, %T A336004 67,70,71,73,74,75,76,77,78,79,85,86,89,94,95,97,98,103,104,107,112, %U A336004 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,131 %N A336004 Numbers whose mixed binary-ternary representation is not a binary or ternary representation. See Comments. %C A336004 Suppose that B1 and B2 are increasing sequences of positive integers, and let B be the increasing sequence of numbers in the union of B1 and B2. Every positive integer n has a unique representation given by the greedy algorithm with B1 as base, and likewise for B2 and B. For many n, the number of terms in the B-representation of n is less than the number of terms in the B1-representation, as well as the B2-representation, but not for all n, as in the example 45 = 27 + 18 (ternary) and 45 = 32 + 9 + 4 (mixed). %C A336004 Note that 1 and 2 = 10_2 = 2_3 are each representable as terms in both binary and ternary. - _Michael S. Branicky_, Jan 06 2022 %e A336004 7 = 6 + 1 = 21_3 is not a term; %e A336004 11 = 9 + 2 = 102_3 is not a term; %e A336004 13 = 9 + 4 = 3^2 + 2^2 is a term; %e A336004 22 = 18 + 4 = 2*3^2 + 2^2 is a term. %t A336004 u = Table[2^n, {n, 0, 50}]; v = Table[3^n, {n, 0, 40}]; %t A336004 uQ[n_] := MemberQ[u, n]; vQ[n_] := MemberQ[v, n]; %t A336004 Attributes[uQ] = {Listable}; Attributes[vQ] = {Listable}; %t A336004 s = Reverse[Union[Flatten[Table[{2^(n - 1), 3^n}, {n, 1, 30}]]]]; %t A336004 w = Map[#[[1]] &,Select[Map[{#[[1]], {Apply[And, uQ[#[[2]]]], %t A336004 Apply[And, vQ[#[[2]]]]}} &, Map[{#, DeleteCases[ %t A336004 s Reap[FoldList[(Sow[Quotient[#1, #2]]; Mod[#1, #2]) &, #, %t A336004 s]][[2, 1]], 0]} &, %t A336004 Range[700]]], #[[2]] == {False, False} &]] %t A336004 (* _Peter J. C. Moses_, Jun 14 2020 *) %o A336004 (Python) %o A336004 from itertools import count, takewhile %o A336004 N = 10**6 %o A336004 B1 = list(takewhile(lambda x: x[0] <= N, ((2**i, 2) for i in count(0)))) %o A336004 B21 = list(takewhile(lambda x: x[0] <= N, ((3**i, 3) for i in count(0)))) %o A336004 B22 = list(takewhile(lambda x: x[0] <= N, ((2*3**i, 3) for i in count(0)))) %o A336004 B = sorted(set(B1 + B21 + B22), reverse=True) %o A336004 def ok(n): %o A336004 r, bases = [], set() %o A336004 for t, b in B: %o A336004 if t <= n: %o A336004 r.append(t) %o A336004 if t != 1 and t != 2: %o A336004 bases.add(b) %o A336004 n -= t %o A336004 if n == 0: %o A336004 return len(bases) == 2 %o A336004 print([k for k in range(1, 132) if ok(k)]) # _Michael S. Branicky_, Jan 06 2022 %Y A336004 Cf. A000079, A000244, A336005, A336006, A336007. %K A336004 nonn,base %O A336004 1,1 %A A336004 _Clark Kimberling_, Jul 06 2020 %E A336004 Terms and examples corrected by _Michael S. Branicky_, Jan 06 2022