login
A118402
Row sums of triangle A118401.
5
1, 1, 3, 1, 5, -1, 7, -3, 9, -5, 11, -7, 13, -9, 15, -11, 17, -13, 19, -15, 21, -17, 23, -19, 25, -21, 27, -23, 29, -25, 31, -27, 33, -29, 35, -31, 37, -33, 39, -35, 41, -37, 43, -39, 45, -41, 47, -43, 49, -45, 51, -47, 53, -49, 55, -51, 57, -53, 59, -55, 61, -57, 63, -59, 65, -61, 67, -63, 69, -65, 71
OFFSET
0,3
FORMULA
G.f.: (1+2*x+2*x^2)*(1+x^2)/(1+x)^2/(1-x).
a(n^2-n+2) = A118403(n).
a(2n) = 2n+1, a(2n+1) = 3-2n, n>0. - Ralf Stephan, Aug 18 2013
a(n) = (5+(-1)^n*(2*n-3))/2 for n>1. - Peter Luschny, Aug 04 2014
MAPLE
a := n -> `if`(n=1, 1, (5+(-1)^n*(2*n-3))/2);
seq(a(n), n=0..70); # Peter Luschny, Aug 04 2014
MATHEMATICA
Join[{1, 1}, LinearRecurrence[{-1, 1, 1}, {3, 1, 5}, 70]] (* Jean-François Alcover, Jun 13 2019 *)
PROG
(PARI) {a(n)=polcoeff((1+2*x+2*x^2)*(1+x^2)/(1+x+x*O(x^n))^2/(1-x), n, x)}
CROSSREFS
Sequence in context: A340083 A339667 A322993 * A122383 A292393 A136180
KEYWORD
sign
AUTHOR
Paul D. Hanna, Apr 27 2006
STATUS
approved