OFFSET
1,1
COMMENTS
Numbers k such that k == 5 or 8 mod 13. - Charles R Greathouse IV, Dec 28 2011
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = a(n-1)+a(n-2)-a(n-3).
G.f.: x*(5+3*x+5*x^2)/((1+x)*(x-1)^2) .
a(n) = 13*(n-1/2)/2 -7*(-1)^n/4.
a(n) = a(n-2)+13. - M. F. Hasler, Jun 16 2010
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(3*Pi/26)*Pi/13. - Amiram Eldar, Feb 27 2023
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {5, 8, 18}, 50] (* Vincenzo Librandi, Feb 26 2012 *)
Select[Range[1000], PowerMod[#, 2, 13] == 12 &] (* Vincenzo Librandi, Apr 24 2014 *)
PROG
(Magma) I:=[5, 8, 18]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 26 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jan 20 2009
EXTENSIONS
Algebra simplified by R. J. Mathar, Aug 18 2009
Edited by N. J. A. Sloane, Jun 23 2010
STATUS
approved