%I #21 Feb 23 2024 07:23:44
%S 1,1,-3,1,5,-7,-3,17,-11,-23,45,1,-91,89,93,-271,85,457,-627,-287,
%T 1541,-967,-2115,4049,181,-8279,7917,8641,-24475,7193,41757,-56143,
%U -27371,139657,-84915,-194399,364229,24569,-753027,703889,802165,-2209943,605613,3814273,-5025499,-2603047
%N a(0)=1, a(1)=1; thereafter a(n) = -a(n-1) - 2*a(n-2).
%C Cassels, following Nagell, shows that a(n) = +- 1 only for n = 1, 2, 3, 5, 13.
%C The sequences A001607, A077020, A107920, A167433, A169998 are all essentially the same except for signs.
%D J. W. S. Cassels, Local Fields, Cambridge, 1986, see p. 67.
%H F. Beukers, <a href="http://www.numdam.org/item?id=CM_1980__40_2_251_0">The multiplicity of binary recurrences</a>, Compositio Mathematica, Tome 40 (1980) no. 2 , p. 251-267. See Theorem 2 p. 259.
%H M. Mignotte, <a href="http://pmb.univ-fcomte.fr/1989/Mignotte.pdf">Propriétés arithmétiques des suites récurrentes</a>, Besançon, 1988-1989, see p. 14. In French.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-2).
%F G.f.: ( 1+2*x ) / ( 1+x+2*x^2 ). - _R. J. Mathar_, Jul 14 2011
%p f:=proc(n) option remember; if n <= 1 then 1 else -f(n-1)-2*f(n-2); fi; end;
%t LinearRecurrence[{-1, -2}, {1, 1}, 46] (* _Jean-François Alcover_, Feb 23 2024 *)
%o (PARI) a(n)=([0,1;-2,-1]^n*[1;1])[1,1] \\ _Charles R Greathouse IV_, Jun 11 2015
%K sign,easy
%O 0,3
%A _N. J. A. Sloane_, Aug 29 2010