%I #37 May 18 2024 14:53:42
%S 0,1,7,31,115,391,1267,3991,12355,37831,115027,348151,1050595,3164071,
%T 9516787,28599511,85896835,257887111,774054547,2322950071,6970423075,
%U 20914414951,62749536307,188261191831,564808741315,1694476555591
%N a(n) = 2*3^n - 3*2^n + 1.
%C Starting with offset 1 = binomial transform of A068293: (1, 6, 18, 42, 90, ...) and double binomial transform of (1, 5, 7, 5, 7, 5, ...). - _Gary W. Adamson_, Jan 13 2009
%C Number of pairs (A,B) where A and B are nonempty subsets of {1,2,...,n} and one of these subsets is a subset of the other. - For the case that one of these subsets is a proper subset of the other see a(n+1) in A260217. - If empty subsets are included, see A027649 (all subsets) and A056182 (proper subsets). - _Manfred Boergens_, Aug 02 2023
%H Christian Ballot and Florian Luca, <a href="https://nyjm.albany.edu/j/2006/12-3.html">Prime factors of a^f(n)-1 with an irreducible polynomial f(x)</a>,New York J. Math. 12 (2006), 39-45 (electronic).
%H Christian Ballot and Florian Luca, <a href="http://pcwww.liv.ac.uk/~karpenk/JournalUDT/vol02/no2/BallotLu07.pdf">Common prime factors of a^n-b and c^n-d</a>, Unif. Distrib. Theory 2 (2007), no. 2, 19-34 (electronic).
%H John Elias, <a href="/A091344/a091344.png">Illustration of initial terms: Sixfold Sierpinski Stars</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (6,-11,6).
%F a(n) = Sum_{i=1..n} i!*i^2*Stirling2(n,i)*(-1)^(n-i).
%F From Christian Ballot via _R. K. Guy_, Jan 13 2009: (Start)
%F a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3);
%F G.f.: x*(1+x)/((1-x)*(2-x)*(3-x)). (End)
%F a(n) = 5*a(n-1) - 6*a(n-2) + 2, a(0)=0, a(1)=1. - _Vincenzo Librandi_, Nov 25 2010
%F E.g.f.: exp(x)*(1 - 3*exp(x) + 2*exp(2*x)). - _Stefano Spezia_, May 18 2024
%p a:=n->sum((3^(n-j-1)-2^(n-2-j))*12, j=0..n): seq(a(n), n=-1..24); # _Zerinvary Lajos_, Feb 11 2007
%p with (combinat):a:=n->stirling2(n,3)+stirling2(n+1,3): seq(a(n), n=1..26); # _Zerinvary Lajos_, Oct 07 2007
%t Table[Sum[i!i^2 StirlingS2[n, i](-1)^(n - i), {i, 1, n}], {n, 0, 30}]
%t Table[2*3^n-3*2^n+1,{n,0,30}] (* or *) LinearRecurrence[{6,-11,6},{0,1,7},30] (* _Harvey P. Dale_, Dec 31 2013 *)
%Y Cf. A027649, A056182, A068293, A260217.
%K easy,nonn
%O 0,3
%A Mario Catalani (mario.catalani(AT)unito.it), Jan 01 2004
%E Edited by _N. J. A. Sloane_, Jan 13 2009 at the suggestion of _R. K. Guy_; the concise definition was provided by _Vladeta Jovovic_, Jan 01 2004