Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #17 Jul 12 2023 05:50:49
%S 2,0,4,2,16,20,78,140,416,878,2324,5280,13282,31200,76724,182962,
%T 445376,1069300,2591118,6239980,15089776,36389278,87917284,212144640,
%U 512334722,1236606720,2985883684,7207831202,17402424496,42011258900
%N Constant term of the reduction by x^2 -> x+2 of the polynomial p(n,x) defined below in Comments.
%C The polynomial p(n,x) is defined by ((x+d)/2)^n + ((x-d)/2)^n, where d = sqrt(x^2+4). For an introduction to reductions of polynomials by substitutions such as x^2 -> x+2, see A192232.
%H G. C. Greubel, <a href="/A192423/b192423.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,4,-1,-1).
%F From _Colin Barker_, May 11 2014: (Start)
%F a(n) = a(n-1) + 4*a(n-2) - a(n-3) - a(n-4).
%F G.f.: 2*(1+x)*(1-2*x) / ((1+x-x^2)*(1-2*x-x^2)). (End)
%F From _G. C. Greubel_, Jul 11 2023: (Start)
%F a(n) = Sum_{j=0..n} T(n, j)*A078008(j), where T(n, k) = [x^k] ((x + sqrt(x^2+4))^n + (x - sqrt(x^2+4))^n)/2^n.
%F a(n) = (2/3)*((-1)^n*A000032(n) + A000129(n+1) - A000129(n)). (End)
%e The first five polynomials p(n,x) and their reductions are as follows:
%e p(0,x) = 2 -> 2
%e p(1,x) = x -> x
%e p(2,x) = 2 + x^2 -> 4 + x
%e p(3,x) = 3*x + x^3 -> 2 + 6*x
%e p(4,x) = 2 + 4*x^2 + x^4 -> 16 + 9*x.
%e From these, read a(n) = (2, 0, 4, 2, 16, ...) and A192424 = (0, 1, 1, 6, 9, ...).
%t q[x_]:= x+2; d= Sqrt[x^2+4];
%t p[n_, x_]:= ((x+d)/2)^n + ((x-d)/2)^n (* A161514 *)
%t Table[Expand[p[n, x]], {n, 0, 6}]
%t reductionRules = {x^y_?EvenQ -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)};
%t t= Table[FixedPoint[Expand[#1/. reductionRules] &, p[n,x]], {n,0,30}]
%t Table[Coefficient[Part[t, n], x, 0], {n,30}] (* A192423 *)
%t Table[Coefficient[Part[t, n], x, 1], {n,30}] (* A192424 *)
%t Table[Coefficient[Part[t, n]/2, x, 1], {n,30}] (* A192425 *)
%t LinearRecurrence[{1,4,-1,-1}, {2,0,4,2}, 40] (* _G. C. Greubel_, Jul 11 2023 *)
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 2*(1+x)*(1-2*x)/((1+x-x^2)*(1-2*x-x^2)) )); // _G. C. Greubel_, Jul 11 2023
%o (SageMath)
%o @CachedFunction
%o def a(n): # a = A192423
%o if (n<4): return (2,0,4,2)[n]
%o else: return a(n-1) +4*a(n-2) -a(n-3) -a(n-4)
%o [a(n) for n in range(41)] # _G. C. Greubel_, Jul 11 2023
%Y Cf. A000032, A000129, A078008, A161514, A192232, A192424, A192425.
%K nonn,easy
%O 0,1
%A _Clark Kimberling_, Jun 30 2011