OFFSET
0,3
COMMENTS
Old name was "Modified triangular numbers".
Starting with offset 1 = row sums of an infinite lower triangular matrix with alternate columns of (1, 3, 5, 7, ...) and (1, 0, 0, 0, ...) (see example). - Gary W. Adamson, May 14 2010
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
E.g.f.: cosh(x)+exp(x)*(x+x^2/2).
a(n) = Sum_{k=0..n} k+(-1)^k.
G.f.: (1-x+2*x^2)/((1-x)^3*(1+x)). - R. J. Mathar, Apr 02 2008
a(0) = 1, a(n) = n^2 - a(n-1) + 1 for n >= 1. - Richard R. Forberg, Jun 05 2013
a(n) = 1 + floor(n/2) + floor(n^2/2). - Wesley Ivan Hurt, Jun 15 2013
a(n) + a(n+1) = A002522(n+1). - R. J. Mathar, May 21 2018
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4). - Wesley Ivan Hurt, Dec 23 2021
EXAMPLE
From Gary W. Adamson, May 14 2010: (Start)
First few rows of the triangle with row sums = A084263 =
1;
3, 1;
5, 0, 1;
7, 0, 3, 1;
9, 0, 5, 0, 1;
11, 0, 7, 0, 3, 1;
...
Example: a(4) = 11 = (7 + 0 + 3 + 1). (End)
MATHEMATICA
Table[(-1)^n/2 + (n^2 + n + 1)/2, {n, 0, 100}] (* Wesley Ivan Hurt, Dec 23 2021 *)
LinearRecurrence[{2, 0, -2, 1}, {1, 1, 4, 6}, 60] (* Harvey P. Dale, Jun 10 2023 *)
PROG
(PARI) a(n)=n*(n+1)/2+(1-n)%2 \\ Charles R Greathouse IV, Jun 04 2013
(Magma) [(-1)^n/2+(n^2+n+1)/2 : n in [0..80]]; // Wesley Ivan Hurt, Dec 23 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 31 2003
EXTENSIONS
Name changed by Wesley Ivan Hurt, Dec 23 2021
STATUS
approved