login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A130404 Partial sums of A093178. 1

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

%S 1,2,3,6,7,12,13,20,21,30,31,42,43,56,57,72,73,90,91,110,111,132,133,

%T 156,157,182,183,210,211,240,241,272,273,306,307,342,343,380,381,420,

%U 421,462,463,506,507,552,553,600,601,650,651,702,703,756,757,812,813

%N Partial sums of A093178.

%C Numbers n such that floor(n/2) is a positive triangular number. - _Bruno Berselli_, Sep 15 2014

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

%F a(1) = 1; for n > 1, a(n) = a(n-1)+1 if n is odd, a(n) = a(n-1)+(n-1) if n is even.

%F a(n) = A002061((n+1)/2) = (n^2+3)/4 if n is odd, a(n) = A002378(n/2) = (n^2+2*n)/4) if n is even.

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

%F a(n) = A093178(n) - A093178(n-1).

%F a(1) = 1; a(n) = a(n-1) + n^(n mod 2) = (1/4)*(n^2 + 2n + 4 + (n mod 2)*(2n-1)). - _Rolf Pleisch_, Feb 04 2008

%F a(n) = (2*(n-1)*(n+2) + (2*n-3)*(-1)^n+7)/8. - _Bruno Berselli_, Mar 31 2011

%t Table[If[EvenQ[n], 1, n], {n, 0, 56}] // Accumulate (* _Jean-François Alcover_, Jun 10 2013 *)

%t Accumulate[Join[{1},Riffle[Range[1,85,2],1]]] (* or *) LinearRecurrence[ {1,2,-2,-1,1},{1,2,3,6,7},90] (* _Harvey P. Dale_, Jun 01 2016 *)

%o (PARI) {s=0; for(n=1, 57, s=s+if(n%2>0, 1, n-1); print1(s, ","))}

%o (PARI) {for(n=1, 57, print1(if(n%2>0, (n^2+3)/4, (n^2+2*n)/4), ","))}

%o (Magma) &cat[ [ n^2-n+1, n*(n+1) ]: n in [1..29] ];

%Y Cf. A093178, A002061, A002378, A247375.

%K nonn,easy

%O 1,2

%A _Klaus Brockhaus_, May 25 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)