%I #40 Sep 08 2022 08:45:05
%S 0,0,1,7,33,131,473,1611,5281,16867,52905,163835,502769,1532883,
%T 4651897,14070379,42456897,127894979,384799049,1156756443,3475250065,
%U 10436235955,31330727961,94038321227,282211432673,846835624611
%N Expansion of x^2/((1-3*x)*(1-2*x)^2).
%C Binomial transform of A000295.
%C a(n) = A112626(n, 2). - _Ross La Haye_, Jan 11 2006
%C Let Q be a binary relation on the power set P(A) of a set A having n = |A| elements such that for all x,y of P(A), xQy if x is a proper subset of y and |y| - |x| > 1. Then a(n) = |Q|. - _Ross La Haye_, Jan 11 2008
%C a(n) is the number of n-digit ternary sequences that have at least two 0's. - _Geoffrey Critzer_, Apr 14 2009
%H Harry J. Smith, <a href="/A066810/b066810.txt">Table of n, a(n) for n = 0..200</a>
%H Ross La Haye, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/LaHaye/lahaye5.html">Binary Relations on the Power Set of an n-Element Set</a>, Journal of Integer Sequences, Vol. 12 (2009), Article 09.2.6.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (7,-16,12).
%F a(n) = 3^n - 2^n - n*2^(n-1).
%F From _Ross La Haye_, Apr 26 2006: (Start)
%F a(n) = A000244(n) - A001792(n).
%F a(n) = Sum_{k=2..n} binomial(n,k)2^(n-k). (End)
%F Inverse binomial transform of A086443. - _Ross La Haye_, Apr 29 2006
%F Convolution of A000244 beginning [0,1,3,9,27,81,...] and A001787. - _Ross La Haye_, Feb 15 2007
%F From _Geoffrey Critzer_, Apr 14 2009: (Start)
%F E.g.f.: exp(2*x)*(exp(x) - x - 1).
%F a(n) = 3*a(n-1) + (n-1)*2^(n-2). (End)
%p seq(3^n - 2^n - n*2^(n-1), n=0..30); # _G. C. Greubel_, Nov 18 2019
%t RecurrenceTable[{a[n]==3*a[n-1] + (n-1) 2^(n-2), a[0]==0}, a, {n, 0, 30}] (* _Geoffrey Critzer_, Apr 14 2009 *)
%t CoefficientList[Series[x^2/((1-3x)(1-2x)^2), {x, 0, 30}], x] (* _Vincenzo Librandi_, Nov 29 2015 *)
%o (PARI) for(n=0, 50, write("b066810.txt", n, " ", 3^n -2^n -n*2^(n-1)) ) \\ _Harry J. Smith_, Mar 29 2010
%o (Magma) [3^n-2^n-n*2^(n-1): n in [0..30]]; // _Vincenzo Librandi_, Nov 29 2015
%o (Sage) [3^n - 2^n - n*2^(n-1) for n in (0..30)] # _G. C. Greubel_, Nov 18 2019
%o (GAP) List([0..30], n-> 3^n - 2^n - n*2^(n-1)); # _G. C. Greubel_, Nov 18 2019
%Y Column k=1 of A238858 (with different offset).
%K nonn,easy
%O 0,4
%A _N. J. A. Sloane_, Jan 25 2002
%E Additional comments from _Ross La Haye_, Sep 27 2005