A014637 Odd heptagonal numbers (A000566).
1, 7, 55, 81, 189, 235, 403, 469, 697, 783, 1071, 1177, 1525, 1651, 2059, 2205, 2673, 2839, 3367, 3553, 4141, 4347, 4995, 5221, 5929, 6175, 6943, 7209, 8037, 8323, 9211, 9517, 10465, 10791, 11799, 12145, 13213, 13579, 14707, 15093, 16281, 16687, 17935
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
Mathematica
Table[1/8 (1+(-1)^n+4 n) (-1+5 (-1)^n+20 n),{n,0,42}] (* Ant King, Sep 01 2011 *) Select[PolygonalNumber[7,Range[200]],OddQ] (* or *) LinearRecurrence[{1,2,-2,-1,1},{1,7,55,81,189},50] (* Harvey P. Dale, Sep 14 2022 *)
-
PARI
a(n)=(5*(-1)^n+20*n-1)*(4*n+1+(-1)^n)/8 \\ Charles R Greathouse IV, Sep 01 2011
Formula
G.f.:(1+13*x^4+14*x^3+46*x^2+6*x)/((1+x)^2*(1-x)^3) [From Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009]
From Ant King, Sep 01 2011: (Start)
a(n) = (1/8)*(1+(-1)^n+4*n)*(-1+5*(-1)^n+20*n)
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5)
a(n) = 80+2*a(n-2)-a(n-4)
(End)
Extensions
Extended and description corrected by Patrick De Geest