%I #26 Jan 08 2023 02:43:29
%S 2,2,0,12,20,28,36,44,52,60,68,76,84,92,100,108,116,124,132,140,148,
%T 156,164,172,180,188,196,204,212,220,228,236,244,252,260,268,276,284,
%U 292,300,308,316,324,332,340,348,356,364,372,380,388,396,404,412,420
%N Absolute difference between (sum of previous terms) and (n-th-even square) with a(1) = 2.
%H Nathaniel Johnston, <a href="/A181389/b181389.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1).
%F a(n) = 8*n - 20 for n >= 4. - _Nathaniel Johnston_, May 27 2011
%F G.f.: (-2*x*(-1 + x + x^2 - 7*x^3 + 2*x^4))/(-1 + x)^2. - _Alexander R. Povolotsky_, Oct 18 2010
%F E.g.f.: 20 + 4*exp(x)*(2*x - 5) + x*(42 + (9 - 2*x)*x)/3. - _Stefano Spezia_, Jan 03 2023
%F Sum_{n>=4} (-1)^n/a(n) = (4-Pi)/16. - _Amiram Eldar_, Jan 08 2023
%p A181389 := proc(n) local s: s:=[2,2,0]: if(n<=3)then return s[n]: fi: return 8*n-20: end: seq(A181389(n),n=1..100); # _Nathaniel Johnston_, May 27 2011
%t CoefficientList[Series[(-2*x*(-1 + x + x^2 - 7*x^3 + 2*x^4))/(-1 + x)^2, {x, 0, 50}], x] (* _G. C. Greubel_, Feb 22 2017 *)
%t LinearRecurrence[{2,-1},{2,2,0,12,20},70] (* _Harvey P. Dale_, Feb 13 2022 *)
%o (PARI) my(x='x+O('x^50)); Vec((-2*x*(-1 + x + x^2 - 7*x^3 + 2*x^4))/(-1 + x)^2) \\ _G. C. Greubel_, Feb 22 2017
%Y Cf. A017113.
%K easy,nonn
%O 1,1
%A _Giovanni Teofilatto_, Oct 17 2010
|