login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = 2*n*(n+1)*(n+2)/3 + (-1)^n.
1

%I #20 Mar 04 2023 15:33:35

%S 1,3,17,39,81,139,225,335,481,659,881,1143,1457,1819,2241,2719,3265,

%T 3875,4561,5319,6161,7083,8097,9199,10401,11699,13105,14615,16241,

%U 17979,19841,21823,23937,26179,28561,31079

%N a(n) = 2*n*(n+1)*(n+2)/3 + (-1)^n.

%C First differences in 2*A081352.

%C Second differences in 4*A004442.

%H B. Berselli, <a href="/A179783/b179783.txt">Table of n, a(n) for n = 0..10000</a>.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).

%F G.f.: (1+10*x^2-4*x^3+x^4)/((1+x)*(1-x)^4); exp(-x)+(2/3)*exp(x)*x*(6+6*x+x^2).

%F a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5) for n>4.

%F a(n) = 4*A000292(n)+(-1)^n.

%t LinearRecurrence[{3,-2,-2,3,-1},{1,3,17,39,81},40] (* _Harvey P. Dale_, Mar 04 2023 *)

%o (Magma) [(2/3)*n*(n+1)*(n+2)+(-1)^n: n in [0..35]];

%o (PARI) for(n=0, 35, print1((2/3)*n*(n+1)*(n+2)+(-1)^n", "));

%Y Cf. A005744, A026035, A175109, A131941.

%K nonn,easy

%O 0,2

%A _Bruno Berselli_, Jul 29 2010 - Sep 07 2010