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 A235773 #17 Nov 13 2020 01:23:12 %S A235773 1,1,1,3,2,2,7,2,2,9,8,8,32,6,6,26,6,6,31,26,26,128,6,6,26,6,6,33,32, %T A235773 32,158,30,30,152,30,30,176,150,150,870,24,24,126,24,24,146,126,126, %U A235773 750,24,24,126,24,24,151,146,146,872,126,126,770,126,126,872 %N A235773 Number of compositions of n into distinct powers of 3 and doubled powers of 3. %H A235773 Alois P. Heinz, <a href="/A235773/b235773.txt">Table of n, a(n) for n = 0..10000</a> %e A235773 Let n=5. We have only two allowed compositions 2+3 = 3+2. So a(5) = 2. %e A235773 For n=6, we have compositions 6 = 1+2+3 = 1+3+2 = 2+3+1 = 2+1+3 = 3+2+1 = 3+1+2. Thus a(6) = 7. %p A235773 b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0, %p A235773 expand(b(n, i-1)+`if`(3*3^i>n, 0, b(n-3*3^i, i-1)*x^2) %p A235773 +add(`if`(j*3^i>n, 0, b(n-j*3^i, i-1))*x, j=1..2)))) %p A235773 end: %p A235773 a:= n->(p->add(coeff(p, x, j)*j!, j=0..degree(p)))(b(n, ilog[3](n))): %p A235773 seq(a(n), n=0..100); # _Alois P. Heinz_, Jan 15 2014 %t A235773 b[n_, i_] := b[n, i] = If[n==0, 1, If[i<0, 0, Expand[b[n, i-1] + If[3^(i+1) > n, 0, b[n-3^(i+1), i-1]x^2] + Sum[If[3^i j > n, 0, b[n-3^i j, i-1]]x, {j, 1, 2}]]]]; %t A235773 a[n_] := With[{p = b[n, Log[3, n] // Floor]}, Sum[Coefficient[p, x, j] j!, {j, 0, Exponent[p, x]}]]; %t A235773 a /@ Range[0, 100] (* _Jean-François Alcover_, Nov 12 2020, after _Alois P. Heinz_ *) %Y A235773 Cf. A235684, A078932, A235669. %K A235773 nonn,look %O A235773 0,4 %A A235773 _Vladimir Shevelev_ and _Peter J. C. Moses_, Jan 15 2014