OFFSET
1,1
COMMENTS
The first pair (a,b) is such that a+b=p, a*b=p*h+1, with h<=(p-1)/4; other pairs are given by(a+kp, b+kp), k=1,2,3...
Numbers congruent to {4, 13} mod 17. - Amiram Eldar, Feb 27 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
From M. F. Hasler, Jun 16 2010: (Start)
a(n) = 4*(-1)^(n+1) + 17*floor(n/2).
a(n) = a(n-2) + 17 for all n > 2. (End)
From Bruno Berselli, Sep 26 2010: (Start)
G.f.: x*(4+9*x+4*x^2)/((1+x)*(1-x)^2).
a(n) - a(n-1) - a(n-2) + a(n-3) = 0 for n > 3.
a(n) = (34*n + (-1)^n - 17)/4. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(9*Pi/34)*Pi/17. - Amiram Eldar, Feb 27 2023
MATHEMATICA
Select[Range[500], PowerMod[#, 2, 17]==16&] (* or *) LinearRecurrence[ {1, 1, -1}, {4, 13, 21}, 60] (* Harvey P. Dale, Jun 25 2011 *)
PROG
(PARI) A155095(n)=n\2*17-4*(-1)^n /* M. F. Hasler, Jun 16 2010 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jan 20 2009
EXTENSIONS
Terms checked & minor edits by M. F. Hasler, Jun 16 2010
STATUS
approved