%I #36 Feb 26 2023 03:27:37
%S 6,31,43,68,80,105,117,142,154,179,191,216,228,253,265,290,302,327,
%T 339,364,376,401,413,438,450,475,487,512,524,549,561,586,598,623,635,
%U 660,672,697,709,734,746,771,783,808,820,845,857,882,894,919,931,956,968
%N Numbers k such that k^2 == -1 (mod 37).
%C Numbers k such that k == 6 or 31 (mod 37). - _Charles R Greathouse IV_, Dec 27 2011
%H Vincenzo Librandi, <a href="/A155097/b155097.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F From _M. F. Hasler_, Jun 16 2010: (Start)
%F a(n) = 6*(-1)^(n+1) + 37*floor(n/2).
%F a(2k+1) = 37*k + a(1), a(2k) = 37*k - a(1), with a(1) = A002314(5) since 37 = A002144(5).
%F a(n) = a(n-2) + 37 for all n > 2. (End)
%F G.f.: x*(6 + 25*x + 6*x^2)/((1 + x)*(1 - x)^2). - _Vincenzo Librandi_, May 03 2014
%F Sum_{n>=1} (-1)^(n+1)/a(n) = cot(6*Pi/37)*Pi/37. - _Amiram Eldar_, Feb 26 2023
%t LinearRecurrence[{1,1,-1},{6,31,43},100] (* _Vincenzo Librandi_, Feb 29 2012 *)
%t Select[Range[1000],PowerMod[#,2,37]==36&] (* _Harvey P. Dale_, May 06 2012 *)
%t CoefficientList[Series[(6 + 25 x + 6 x^2)/((1 + x) (1 - x)^2), {x, 0, 30}], x] (* _Vincenzo Librandi_, May 03 2014 *)
%o (PARI) A155097(n)=n\2*37-6*(-1)^n /* _M. F. Hasler_, Jun 16 2010 */
%Y Cf. A002144, A155086, A155095, A155096, A155098.
%K nonn,easy
%O 1,1
%A _Vincenzo Librandi_, Jan 20 2009
%E Terms checked, a(28) corrected, and minor edits by _M. F. Hasler_, Jun 16 2010