OFFSET
1,1
COMMENTS
Numbers congruent to {25, 64} mod 89. - 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).
G.f.: x*(25 + 39*x + 25*x^2)/((1+x)*(x-1)^2).
a(n) = (89 + 11*(-1)^(n-1) + 178*(n-1))/4.
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(39*Pi/178)*Pi/89. - Amiram Eldar, Feb 26 2023
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {25, 64, 114}, 50] (* Vincenzo Librandi, Mar 02 2012 *)
Select[Range[2100], PowerMod[#, 2, 89]==2&] (* Harvey P. Dale, May 09 2019 *)
PROG
(Magma) I:=[25, 64, 114]; [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) for(n=1, 60, print1((89+11*(-1)^(n-1)+178*(n-1))/4", ")); \\ Vincenzo Librandi, Mar 02 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jun 30 2009
EXTENSIONS
Slightly edited by R. J. Mathar, Jul 26 2009
STATUS
approved