OFFSET
1,1
COMMENTS
Numbers congruent to {17, 24} mod 41. - Amiram Eldar, Feb 26 2023
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).
a(n) = (1/4)*(41 + 27*(-1)^(n-1) + 82*(n-1)).
First differences: a(2n) - a(2n-1) = 7, a(2n+1) - a(2n) = 34.
G.f.: x*(17 + 7*x + 17*x^2)/((1+x)*(x-1)^2). - R. J. Mathar, Apr 04 2009
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(7*Pi/82)*Pi/41. - Amiram Eldar, Feb 26 2023
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {17, 24, 58}, 60] (* Vincenzo Librandi, Mar 02 2012 *)
Select[Range[1200], PowerMod[#, 2, 41]==2&] (* Harvey P. Dale, Oct 24 2021 *)
PROG
(Magma) I:=[17, 24, 58]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Mar 02 2012
(PARI) a(n) = (1/4)*(41+27*(-1)^(n-1)+82*(n-1)); \\ Vincenzo Librandi, Mar 02 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Mar 27 2009
EXTENSIONS
Comments translated to formulas by R. J. Mathar, Apr 04 2009
STATUS
approved