OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Vincenzo Librandi, X^2-AY^2=1, Math Forum, 2007. [Wayback Machine link]
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(1)=378, a(2)=1303; a(n) = 2*a(n-1) - a(n-2) - 13^2 if n is odd, and a(n) = 2*a(n-1) - a(n-2) + 13^2 if n is even.
From R. J. Mathar, Mar 08 2009: (Start)
a(n) = (3362n - 1681 + 169*(-1)^n)/4.
G.f.: x*(14*x+27)*(27*x+14)/((1+x)*(x-1)^2). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = cot(378*Pi/1681)*Pi/1681. - Amiram Eldar, Feb 26 2023
EXAMPLE
378^2 + 1 == 0 (mod 41^2).
1303^2 + 1 == 0 (mod 41^2).
2059^2 + 1 == 0 (mod 41^2).
MATHEMATICA
CoefficientList[Series[(14 x + 27) (27 x + 14) / ((1 + x) (x - 1)^2), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 11 2013 *)
Select[Range[30000], PowerMod[#, 2, 1681]==1680&] (* or *) LinearRecurrence[ {1, 1, -1}, {378, 1303, 2059}, 40] (* Harvey P. Dale, Jul 05 2021 *)
PROG
(Magma) [(3362*n-1681+169*(-1)^n)/4: n in [1..40]]; // Vincenzo Librandi, Sep 11 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Feb 23 2009
STATUS
approved