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 A178759 #31 Jun 12 2025 03:39:37 %S A178759 0,0,0,18,144,750,3240,12642,46368,163350,559800,1881066,6229872, %T A178759 20406750,66273480,213759090,685601856,2188698150,6959413080, %U A178759 22053083514,69672773520,219535296750,690106487400,2164714299138,6777100916064,21179698653750,66083277045240,205880260458762 %N A178759 Expansion of e.g.f. 3*x*exp(x)*(exp(x)-1)^2. %C A178759 a(n) is the sum of the digits in ternary sequences of length n, in which each element of the alphabet, {0,1,2} appears at least once in the sequence. %C A178759 Generally, the e.g.f. for such sum of n-ary sequences (taken on an alphabet of {0,1,2,...,n-1}) is binomial(n,2)*x*exp(x)*(exp(x)-1)^(n-1). %C A178759 Cf. A058877 which is the sum of the digits in such binary sequences. %H A178759 Colin Barker, <a href="/A178759/b178759.txt">Table of n, a(n) for n = 0..1000</a> %H A178759 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (12,-58,144,-193,132,-36). %F A178759 E.g.f.: 3*x*exp(x)*(exp(x)-1)^2. %F A178759 a(n) = (3^n - 3*2^n + 3)*n. - _Mark van Hoeij_, May 13 2013 %F A178759 G.f.: 6*x^3*(11*x^2-12*x+3) / ((x-1)^2*(2*x-1)^2*(3*x-1)^2). - _Colin Barker_, Nov 30 2014 %e A178759 a(3)=18 because there are six length 3 sequences on {0,1,2} that contain at least one 0, at least one 1 and at least one 2: (0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,0,1),(2,1,0). The digits sum to 18. %t A178759 Range[0,20]! CoefficientList[Series[3x Exp[x](Exp[x]-1)^2,{x,0,20}],x] %t A178759 Table[(3^n -3*2^n +3)*n, {n,0,30}] (* _G. C. Greubel_, Jan 24 2019 *) %o A178759 (PARI) my(x='x+O('x^30)); concat([0,0,0],Vec(serlaplace(3*x*exp(x)*(exp(x)-1)^2))) \\ _Joerg Arndt_, May 13 2013 %o A178759 (PARI) concat([0,0,0], Vec(6*x^3*(11*x^2-12*x+3)/((x-1)^2*(2*x-1)^2*(3*x-1)^2) + O(x^100))) \\ _Colin Barker_, Nov 30 2014 %o A178759 (PARI) vector(30, n, n--; (3^n - 3*2^n + 3)*n) \\ _G. C. Greubel_, Jan 24 2019 %o A178759 (Magma) [(3^n - 3*2^n + 3)*n: n in [0..30]]; // _G. C. Greubel_, Jan 24 2019 %o A178759 (Sage) [(3^n - 3*2^n + 3)*n for n in (0..30)] # _G. C. Greubel_, Jan 24 2019 %o A178759 (GAP) List([0..30], n -> (3^n - 3*2^n + 3)*n); # _G. C. Greubel_, Jan 24 2019 %Y A178759 Cf. A058877, A178756. %K A178759 nonn,easy %O A178759 0,4 %A A178759 _Geoffrey Critzer_, Dec 26 2010