%I #25 Sep 08 2022 08:46:09
%S 3,11,18,123,843,5778,39603,271443,1860498,12752043,87403803,
%T 599074578,4106118243,28143753123,192900153618,1322157322203,
%U 9062201101803,62113250390418,425730551631123,2918000611027443,20000273725560978,137083915467899403,939587134549734843
%N Lucas numbers (A000204) of the form n^2 + 2.
%C a(n) = {11} union {A000204(2+4*n)} for n=0,1,...
%C Intersection of A000204 and A059100. - _Michel Marcus_, Aug 26 2014
%H Colin Barker, <a href="/A246453/b246453.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (7,-1).
%F From _Colin Barker_, Jun 20 2017: (Start)
%F G.f.: x*(3 - 10*x - 56*x^2 + 8*x^3) / (1 - 7*x + x^2).
%F a(n) = (2^(-n)*((7+3*sqrt(5))^n*(-20+9*sqrt(5)) + (7-3*sqrt(5))^n*(20+9*sqrt(5)))) / sqrt(5) for n>2.
%F a(n) = 7*a(n-1) - a(n-2) for n>4. (End)
%p with(combinat,fibonacci):lst:={}:lst1:={}:nn:=5000:
%p for n from 1 to nn do:
%p lst:=lst union {2*fibonacci(n-1)+fibonacci(n)}:
%p od:
%p for m from 1 to nn do:
%p if {m^2+2} intersect lst = {m^2+2}
%p then
%p lst1:=lst1 union {m^2+2}:
%p else
%p fi:
%p od:
%p print(lst1):
%t CoefficientList[Series[x*(3-10*x-56*x^2+8*x^3)/(1-7*x+x^2), {x,0,50}], x] (* or *) LinearRecurrence[{7,-1}, {3, 11, 18, 123}, 30] (* _G. C. Greubel_, Dec 21 2017 *)
%t Select[LucasL[Range[100]],IntegerQ[Sqrt[#-2]]&] (* _Harvey P. Dale_, Dec 31 2018 *)
%o (PARI) lista(nn) = for (n=0, nn, luc = fibonacci(n+1) + fibonacci(n-1); if (issquare(luc-2), print1(luc, ", "))); \\ _Michel Marcus_, Mar 29 2016
%o (PARI) Vec(x*(3 - 10*x - 56*x^2 + 8*x^3) / (1 - 7*x + x^2) + O(x^30)) \\ _Colin Barker_, Jun 20 2017
%o (Magma) I:=[3,11,18,123]; [n le 4 select I[n] else 7*Self(n-1)-Self(n-2): n in [1..30]]; // _G. C. Greubel_, Dec 21 2017
%Y Cf. A000204 (Lucas), A059100 (n^2+2).
%Y Cf. quadrisection of A000032: A056854 (first), A056914 (second), this sequence (third, without 11), A288913 (fourth).
%K nonn,easy
%O 1,1
%A _Michel Lagneau_, Aug 26 2014
%E Corrected by _Michel Marcus_, Mar 29 2016