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!)
A256137 a(2) = 1; a(3) = 4; for n >= 4, a(n) = 2 + Sum_{i=4..n} d(i), where d(i) = i for even i, d(i) = i-3 for odd i. 1

%I #40 Sep 03 2015 10:54:17

%S 1,4,6,8,14,18,26,32,42,50,62,72,86,98,114,128,146,162,182,200,222,

%T 242,266,288,314,338,366,392,422,450,482,512,546,578,614,648,686,722,

%U 762,800,842,882,926,968,1014,1058,1106,1152,1202,1250,1302,1352,1406

%N a(2) = 1; a(3) = 4; for n >= 4, a(n) = 2 + Sum_{i=4..n} d(i), where d(i) = i for even i, d(i) = i-3 for odd i.

%H Colin Barker, <a href="/A256137/b256137.txt">Table of n, a(n) for n = 2..1000</a>

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

%F a(2) = 1; a(3) = 4; for n >= 4, a(n) = 2 + Sum_{i=4..n} d(i), where d(i) = i for even i, d(i) = i-3 for odd i.

%F From _Colin Barker_, Jul 12 2015 and Aug 20 2015: (Start)

%F a(n) = (5+3*(-1)^n-4*n+2*n^2)/4 for n>3.

%F a(n) = (n^2-2*n+4)/2 for n even and n>3.

%F a(n) = (n^2-2*n+1)/2 for n odd and n>3.

%F a(n) = 2*a(n-1)-2*a(n-3)+a(n-4) for n>6.

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

%F (End)

%t Prepend[Table[2 + Sum[If[EvenQ@ i, i, i - 3], {i, 3, n}], {n, 3, 48}], 1] (* _Michael De Vlieger_, Jul 12 2015 *)

%t Join[{1, 2, 6, 8, 14, 18}, LinearRecurrence[{2, 0, -2, 1}, {26, 32, 42, 50}, 50]] (* _Vincenzo Librandi_, Jul 16 2015 *)

%o (PARI) a=4; print1("1, ", a,", "); for (n=4,100, if (Mod(n,2)==0, d=n, d=n-3); a=a+d; print1(a, ", "))

%o (PARI) Vec(x^2*(2*x^5-5*x^4+2*x^3+2*x^2-2*x-1)/((x-1)^3*(x+1)) + O(x^100)) \\ _Colin Barker_, Jul 12 2015 and Aug 20 2015

%o (PARI) a(n)=if(n<3,1,(n^2-2*n)\2+2-(n%2)) \\ _Charles R Greathouse IV_, Jul 17 2015

%K nonn,easy

%O 2,2

%A _Kival Ngaokrajang_, Jul 11 2015

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 24 11:49 EDT 2024. Contains 371936 sequences. (Running on oeis4.)