login
Even heptagonal numbers (A000566).
5

%I #17 Jan 27 2016 09:17:45

%S 0,18,34,112,148,286,342,540,616,874,970,1288,1404,1782,1918,2356,

%T 2512,3010,3186,3744,3940,4558,4774,5452,5688,6426,6682,7480,7756,

%U 8614,8910,9828,10144,11122,11458,12496,12852,13950,14326,15484,15880,17098,17514,18792

%N Even heptagonal numbers (A000566).

%H Colin Barker, <a href="/A014640/b014640.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,2,-2,-1,1).

%F G.f.: -2*x*(2*x^3+21*x^2+8*x+9) / ((x+1)^2*(x-1)^3) [From Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009]

%F a(0)=0, a(1)=18, a(2)=34, a(3)=112, a(4)=148, a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5). - _Harvey P. Dale_, Jun 16 2014

%F From _Colin Barker_, Jan 27 2016: (Start)

%F a(n) = (20*n^2-10*(-1)^n*n+4*n-(-1)^n+1)/2.

%F a(n) = 10*n^2-3*n for n even.

%F a(n) = 10*n^2+7*n+1 for n odd.

%F (End)

%t Select[Table[(n(5n-3))/2,{n,0,100}],EvenQ] (* or *) LinearRecurrence[ {1,2,-2,-1,1},{0,18,34,112,148},50] (* _Harvey P. Dale_, Jun 16 2014 *)

%o (PARI) concat(0, Vec(2*x*(9+8*x+21*x^2+2*x^3)/((1-x)^3*(1+x)^2) + O(x^100))) \\ _Colin Barker_, Jan 27 2016

%Y Cf. A000566, A014637, A014773, A014792.

%K nonn,easy

%O 0,2

%A _Mohammad K. Azarian_

%E Extended and description corrected by _Patrick De Geest_