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 A129370 #15 Jan 31 2024 14:20:23 %S A129370 0,1,4,8,16,21,36,40,64,65,100,96,144,133,196,176,256,225,324,280,400, %T A129370 341,484,408,576,481,676,560,784,645,900,736,1024,833,1156,936,1296, %U A129370 1045,1444,1160,1600,1281,1764,1408 %N A129370 a(n) = n^2 - (n-1)^2*(1 - (-1)^n)/8. %C A129370 Partial sums are A129371. %H A129370 G. C. Greubel, <a href="/A129370/b129370.txt">Table of n, a(n) for n = 0..5000</a> %H A129370 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-3,0,1). %F A129370 a(n) = (1/8)*( (7*n^2 + 2*n - 1) + (-1)^n*(n-1)^2 ). %F A129370 G.f.: x*(1 + 4*x + 5*x^2 + 4*x^3)/(1-x^2)^3. %F A129370 E.g.f.: (1/4)*( x*(5+4*x)*cosh(x) - (1-4*x-3*x^2)*sinh(x) ). - _G. C. Greubel_, Jan 31 2024 %t A129370 Table[n^2-(n-1)^2 (1-(-1)^n)/8,{n,0,50}] (* _Harvey P. Dale_, Oct 22 2011 *) %o A129370 (PARI) a(n)=n^2-(n-1)^2*(1-(-1)^n)/8 \\ _Charles R Greathouse IV_, Sep 28 2015 %o A129370 (Magma) [n^2 -(n-1)^2*(n mod 2)/4: n in [0..60]]; // _G. C. Greubel_, Jan 31 2024 %o A129370 (SageMath) [n^2 -(n-1)^2*(n%2)/4 for n in range(61)] # _G. C. Greubel_, Jan 31 2024 %Y A129370 Cf. A000567 (odd bisection), A016742 (even bisection), A129371. %K A129370 easy,nonn %O A129370 0,3 %A A129370 _Paul Barry_, Apr 11 2007