%I #37 Mar 05 2023 10:10:52
%S 4,4,12,24,40,60,84,112,144,180,220,264,312,364,420,480,544,612,684,
%T 760,840,924,1012,1104,1200,1300,1404,1512,1624,1740,1860,1984,2112,
%U 2244,2380,2520,2664,2812,2964,3120,3280,3444,3612,3784,3960,4140,4324,4512
%N Least k > 0 such that (4*n^2 + 2)*(k^2) + (4*n^2 + 2)*k + 1 = j^2.
%C For k there is always a recurrence.
%C For n=1, k(1,1) = 0, k(2,1) = 4 then k(i,1) = 10*k(i-1,1) + 4 - k(i-3,n).
%C For n>1, k(1,n) = 0, k(2,n) = 2*n^2 - 2*n, k(3,n) = 2*n^2 + 2*n, k(4,n) = (8*n^2+2)*k(2,n) + 4*n^2 then k(i,n) = (8*n^2+2)*k(i-2,n) + 4*n^2 - k(i-4,n).
%H Stefano Spezia, <a href="/A106232/b106232.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%F a(1) = 4, a(n) = 2*n^2 - 2*n for n > 1, j sequence = A106231.
%F a(n) = A046092(n-1), n > 1. - _R. J. Mathar_, Aug 28 2008
%F G.f.: 4*x*(x^3 - 3*x^2 + 2*x - 1)/(x - 1)^3. - _Colin Barker_, Mar 06 2013
%F E.g.f.: 4*x + 2*x^2*exp(x). - _Stefano Spezia_, Jun 06 2021
%t LinearRecurrence[{3,-3,1},{4,4,12,24},50] (* _Harvey P. Dale_, Mar 05 2023 *)
%o (Magma) [4] cat [2*n*(n+1): n in [1..50]]; // _Vincenzo Librandi_, Apr 06 2020
%o (PARI) a(n) = if(n==1, 4, 2*n^2-2*n); \\ _Jinyuan Wang_, Apr 07 2020
%Y Cf. A046092, A106231.
%K nonn,easy
%O 1,1
%A _Pierre CAMI_, Apr 26 2005
%E More terms from _Colin Barker_, Mar 06 2013