OFFSET
0,3
COMMENTS
a(n) is the determinant of the (n+1) X (n+1) matrix with 0's in the main diagonal and 1's elsewhere. - Franz Vrabec, Dec 01 2007
Sum_{n>0} 1/a(n) = -log(2). - Jaume Oliver Lafont, Feb 24 2009
Pisano period lengths: 1, 2, 6, 4, 10, 6, 14, 8, 18, 10, 22, 12, 26, 14, 30, 16, 34, 18, 38, 20, ... (is this A066043?). - R. J. Mathar, Aug 10 2012
a(n) is the determinant of the (n+1) X (n+1) matrix whose i-th row, j-th column entry is the value of the cubic residue symbol ((j-i)/p) where p is a prime of the form 3k+2 and n < p. - Ryan Wood, Nov 09 2017
a(n-1) is the difference in the number of even minus odd parity derangements (permutations with no fixed points) in symmetric group S_n. - Julian Hatfield Iacoponi, Aug 01 2024
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..2000
Tanya Khovanova, Recursive Sequences
László Németh, The trinomial transform triangle, J. Int. Seqs., Vol. 21 (2018), Article 18.7.3. Also arXiv:1807.07109 [math.NT], 2018.
Index entries for linear recurrences with constant coefficients, signature (-2,-1).
FORMULA
G.f.: -x/(1+x)^2.
E.g.f: -x*exp(-x).
a(n) = -2*a(n-1) - a(n-2) for n >= 2. - Jaume Oliver Lafont, Feb 24 2009
MATHEMATICA
Array[# (-1)^# &, 66, 0] (* Michael De Vlieger, Nov 18 2017 *)
Table[If[EvenQ[n], n, -n], {n, 0, 70}] (* Harvey P. Dale, Jan 17 2022 *)
PROG
(Magma) [n*(-1)^n: n in [0..80]]; // Vincenzo Librandi, Jun 08 2011
(PARI) a(n)=n*(-1)^n \\ Charles R Greathouse IV, Dec 07 2011
(Haskell)
a038608 n = n * (-1) ^ n
a038608_list = [0, -1] ++ map negate
(zipWith (+) a038608_list (map (* 2) $ tail a038608_list))
-- Reinhard Zumkeller, Nov 24 2012
(Python)
def A038608(n): return -n if n&1 else n # Chai Wah Wu, Nov 14 2022
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
EXTENSIONS
Edited by Frank Ellermann, Jan 28 2002
STATUS
approved