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 A140960 #35 Sep 08 2022 08:45:35 %S A140960 0,0,2,6,18,46,114,270,626,1422,3186,7054,15474,33678,72818,156558, %T A140960 334962,713614,1514610,3203982,6757490,14214030,29826162,62448526, %U A140960 130489458,272163726,566697074,1178133390,2445745266,5070447502,10498808946,21713445774,44858547314 %N A140960 a(n) = (2*(-1)^n - 2^(n+1) + 3*n*2^n)/9. %C A140960 Specify that a triangle has T(n,0) = T(n,n) = A001045(n), and T(r,c) = T(r-1,c-1) + T(r-1,c). The sum of the terms in the first n rows is a(n+1). - _J. M. Bergot_, May 21 2013 %C A140960 a(n) is the difference between the total number of runs of equal parts in the compositions of n+1, and the compositions of n+1. - _Gregory L. Simay_, May 04 2017 %H A140960 Vincenzo Librandi, <a href="/A140960/b140960.txt">Table of n, a(n) for n = 0..1000</a> %H A140960 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,0,-4) %F A140960 a(n+1) - 2*a(n) = A078008(n+1) = 2*A001045(n). %F A140960 G.f.: 2*x^2/((1+x)*(1-2*x)^2). %F A140960 a(n) = 2*A045883(n-1). %F A140960 a(n) = 3*a(n-1) - 4*a(n-3), n > 2. %F A140960 a(n) = A059570(n+1) - A011782(n+1). - _Gregory L. Simay_, May 04 2017 %t A140960 LinearRecurrence[{3,0,-4},{0,0,2},40] (* _Harvey P. Dale_, Apr 14 2015 *) %o A140960 (Magma) [( 2*(-1)^n-2^(n+1)+3*n*2^n)/9: n in [0..40]]; // Vincenzo Librandi, Aug 08 2011 %o A140960 (PARI) a(n)=(2*(-1)^n-2^(n+1)+3*n*2^n)/9 \\ _Charles R Greathouse IV_, Oct 16 2015 %K A140960 nonn,easy %O A140960 0,3 %A A140960 _Paul Curtz_, Jul 26 2008 %E A140960 Definition replaced with Lava's closed form of August 2008 by _R. J. Mathar_, Feb 11 2010