login
a(n) = 26*a(n-2) - a(n-4) + 12, with a(0) = 0, a(1) = 4, a(2) = 8, a(3) = 116.
3

%I #23 Jan 01 2024 11:32:11

%S 0,4,8,116,220,3024,5724,78520,148616,2038508,3858304,52922700,

%T 100167300,1373951704,2600491508,35669821616,67512611920,926041410324,

%U 1752727418424,24041406846820,45503400267116,624150536607008

%N a(n) = 26*a(n-2) - a(n-4) + 12, with a(0) = 0, a(1) = 4, a(2) = 8, a(3) = 116.

%C It appears this sequence gives all the nonnegative m such that 42*m^2 + 42*m + 1 is a square.

%H G. C. Greubel, <a href="/A105036/b105036.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,26,-26,-1,1).

%F a(n) = 26*a(n-2) - a(n-4) + 12, for n > 3.

%F From _R. J. Mathar_, Sep 13 2009: (Start)

%F G.f.: 4*x*(1+x+x^2)/((1-x)*(1-26*x^2+x^4)).

%F a(n) = a(n-1) +26*a(n-2) -26*a(n-3) -a(n-4) +a(n-5). (End)

%F From _Ralf Stephan_, Nov 15 2010: (Start)

%F a(2n) = (1/2)*(A097309(n+2) - 9*A097309(n+1) - 1).

%F a(2n+1) = (1/2)*(9*A097309(n+2) - A097309(n+1) - 1). (End)

%t LinearRecurrence[{1,26,-26,-1,1},{0,4,8,116,220},30] (* _Harvey P. Dale_, Mar 25 2013 *)

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); [0] cat Coefficients(R!( 4*x*(1+x+x^2)/((1-x)*(1-26*x^2+x^4)) )); // _G. C. Greubel_, Mar 15 2023

%o (SageMath)

%o @CachedFunction

%o def a(n): # a = A105036

%o if (n<5): return (0,4,8,116,220)[n]

%o else: return a(n-1) +26*a(n-2) -26*a(n-3) -a(n-4) +a(n-5)

%o [a(n) for n in range(41)] # _G. C. Greubel_, Mar 15 2023

%Y Cf. A097309, A105037.

%K nonn

%O 0,2

%A _Gerald McGarvey_, Apr 03 2005