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(4n) = -n^2, a(4n+1) = n^2, a(4n+2) = 1-n^2, a(4n+3) = n*(n+1).
2

%I #18 Sep 08 2022 08:45:30

%S 0,0,1,0,-1,1,0,2,-4,4,-3,6,-9,9,-8,12,-16,16,-15,20,-25,25,-24,30,

%T -36,36,-35,42,-49,49,-48,56,-64,64,-63,72,-81,81,-80,90,-100,100,-99,

%U 110,-121,121,-120,132,-144,144,-143,156,-169,169,-168

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

%C Up to signs, the first differences are in A131804. - _R. J. Mathar_, Mar 17 2009

%H Vincenzo Librandi, <a href="/A131118/b131118.txt">Table of n, a(n) for n = 0..1000</a>

%F From _R. J. Mathar_, Mar 17 2009: (Start)

%F a(n) = -2*a(n-1) -2*a(n-2) -2*a(n-3) +2*a(n-5) +2*a(n-6) +2*a(n-7) +a(n-8).

%F G.f.: x^2*(1+x^2+x^3+2*x)/((1-x)*(1+x^2)^2*(1+x)^3). (End)

%F a(n) = ((-2*n^2+4*n+7)*(-1)^n - 2*((n+4)+(n+2)*(-1)^n)*i^(n*(n+1))+5)/32, where i=sqrt(-1). - _Bruno Berselli_, Mar 27 2012

%p seq(((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32, n=0..60); # _G. C. Greubel_, Nov 18 2019

%t Table[((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial[n+1,2] +5)/32, {n,0,60}] (* _G. C. Greubel_, Nov 18 2019 *)

%o (PARI) a(n) = ((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32; \\ _G. C. Greubel_, Nov 18 2019

%o (Magma) [((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial(n+1,2) +5)/32: n in [0..60]]; // _G. C. Greubel_, Nov 18 2019

%o (Sage) [((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32 for n in (0..60)] # _G. C. Greubel_, Nov 18 2019

%o (GAP) List([0..60], n-> ((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial(n+1,2) +5)/32 ); # _G. C. Greubel_, Nov 18 2019

%K sign,easy

%O 0,8

%A _Paul Curtz_, Sep 24 2007

%E More terms from _Sean A. Irvine_, Mar 13 2011