%I #69 Sep 08 2022 08:45:34
%S 0,1,2,4,4,5,6,8,8,9,10,12,12,13,14,16,16,17,18,20,20,21,22,24,24,25,
%T 26,28,28,29,30,32,32,33,34,36,36,37,38,40,40,41,42,44,44,45,46,48,48,
%U 49,50,52,52,53,54,56,56,57,58,60,60,61,62,64,64,65,66,68,68,69,70,72,72,73,74
%N Partial sums of A140081.
%H Vincenzo Librandi, <a href="/A140201/b140201.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F a(n) = A047624(n+1) - A042948(A004526(n)). - _Reinhard Zumkeller_, Feb 21 2010
%F a(n) = A002265(n+1) + A057353(n+1). - _Reinhard Zumkeller_, Feb 26 2011
%F From _Bruno Berselli_, Jan 27 2011: (Start)
%F G.f.: x*(1+x+2*x^2)/((1+x)*(1+x^2)*(1-x)^2).
%F a(n) = a(n-1) + a(n-4) - a(n-5) for n>4.
%F a(n) = n + A121262(n+1). (End)
%F a(n) = n when n+1 is not a multiple of 4, and a(n) = n+1 when n+1 is a multiple of 4. - _Dennis P. Walsh_, Aug 06 2012
%F a(n) = A004524(n+1) + A004526(n+1). - _Arkadiusz Wesolowski_, Sep 17 2012
%F a(n) = (4*n+1-i^(2*n)+(-i)^(1+n)+i^(1+n))/4 where i=sqrt(-1). - _Wesley Ivan Hurt_, Jun 04 2016
%F a(n) = n+1-(sign((n+1) mod 4) mod 3). - _Wesley Ivan Hurt_, Sep 26 2017
%p A140201:=n->(4*n+1-I^(2*n)+(-I)^(1+n)+I^(1+n))/4: seq(A140201(n), n=0..100); # _Wesley Ivan Hurt_, Jun 04 2016
%t Accumulate[PadRight[{}, 68, {0, 1, 1, 2}]] (* _Harvey P. Dale_, Aug 19 2011 *)
%o (Magma) I:=[0, 1, 2, 4, 4]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..80]]; // _Vincenzo Librandi_, Sep 17 2012
%Y Cf. A002265, A004524, A004526, A042948, A047624, A057353, A121262.
%K easy,nonn
%O 0,3
%A _Nadia Heninger_ and _N. J. A. Sloane_, Jun 09 2008