OFFSET
1,1
COMMENTS
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) = (31+(-1)^(n-1)+62(n-1))/4.
G.f.: x*(8+15*x+8*x^2)/((1+x)*(x-1)^2). - R. J. Mathar, Aug 26 2009
a(n) = 31*(n-1)-a(n-1) with n>1, a(1)=8. - Vincenzo Librandi, Nov 30 2010
Sum_{n>=1} (-1)^(n+1)/a(n) = tan(15*Pi/62)*Pi/31. - Amiram Eldar, Feb 28 2023
EXAMPLE
At n= 4, a(4)=(31-1+186)/4=54. At n=5, a(5)=(31+1+248)/4=70.
MATHEMATICA
Select[Range[850], Mod[#^2, 31]==2&] (* Harvey P. Dale, Feb 04 2011 *)
PROG
(PARI) isok(k) = Mod(k, 31)^2 == 2; \\ Michel Marcus, Nov 22 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Aug 11 2009
EXTENSIONS
Entries checked by R. J. Mathar, Aug 26 2009
STATUS
approved