OFFSET
1,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
YĆ¼ksel Soykan, Summing Formulas For Generalized Tribonacci Numbers, arXiv:1910.03490 [math.GM], 2019.
Index entries for linear recurrences with constant coefficients, signature (-2,0,1).
FORMULA
From R. J. Mathar, Jun 03 2009: (Start)
a(n) = -2*a(n-1) + a(n-3) = (-1)^n*(1 - A118658(n-1)).
G.f.: x*(1+3*x+3*x^2)/((1+x)*(1+x-x^2)). (End)
a(n+3) = (-1)^n * A001595(n) for all n>=0. - M. F. Hasler and Franklin T. Adams-Watters, Sep 30 2009
a(n) = (-1)^(n-1)*(2*Fibonacci(n-2) - 1). - G. C. Greubel, Jul 10 2019
EXAMPLE
a(5) = 3 = ( -3, 8, 0, -7, 5).
MATHEMATICA
Table[(-1)^(n-1)*(2*Fibonacci[n-2] -1), {n, 40}] (* G. C. Greubel, Jul 10 2019 *)
PROG
(PARI) vector(40, n, f=fibonacci; (-1)^(n-1)*(2*f(n-2)-1)) \\ G. C. Greubel, Jul 10 2019
(Magma) [(-1)^(n-1)*(2*Fibonacci(n-2)-1): n in [1..40]]; // G. C. Greubel, Jul 10 2019
(Sage) [(-1)^(n-1)*(2*fibonacci(n-2)-1) for n in (1..40)] # G. C. Greubel, Jul 10 2019
(GAP) List([1..40], n-> (-1)^(n-1)*(2*Fibonacci(n-2)-1)); # G. C. Greubel, Jul 10 2019
CROSSREFS
KEYWORD
sign
AUTHOR
Gary W. Adamson, Mar 11 2007
EXTENSIONS
More terms from R. J. Mathar, Jun 03 2009
Duplicate of a formula removed by R. J. Mathar, Oct 23 2009
Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021
STATUS
approved