login
a(n) = 4*a(n-1) - 4*a(n-2) + 4*a(n-3) with a(0) = 1, a(1) = 3, a(2) = 10.
1

%I #12 Sep 08 2022 08:46:09

%S 1,3,10,32,100,312,976,3056,9568,29952,93760,293504,918784,2876160,

%T 9003520,28184576,88228864,276191232,864587776,2706501632,8472420352,

%U 26522025984,83024429056,259899293696,813587562496,2546850791424,7972650090496,24957547446272

%N a(n) = 4*a(n-1) - 4*a(n-2) + 4*a(n-3) with a(0) = 1, a(1) = 3, a(2) = 10.

%H Reinhard Zumkeller, <a href="/A247595/b247595.txt">Table of n, a(n) for n = 0..1000</a>

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

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

%F 0 = a(n) - 4*a(n-1) + 4*a(n-2) - 4*a(n-3) for all n in Z.

%F a(n) = A061279(2*n) for all n in Z.

%F Binomial transform of A247594.

%e G.f. = 1 + 3*x + 10*x^2 + 32*x^3 + 100*x^4 + 312*x^5 + 976*x^6 + 3056*x^7 + ...

%t CoefficientList[Series[(1-x+2*x^2)/(1-4*x+4*x^2-4*x^3), {x, 0, 60}], x] (* _G. C. Greubel_, Aug 04 2018 *)

%o (PARI) {a(n) = if( n<0, polcoeff( (2*x - x^2 + x^3) / (4 - 4*x + 4*x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 - x + 2*x^2) / (1 - 4*x + 4*x^2 - 4*x^3) + x * O(x^n), n))};

%o (Haskell)

%o a247595 n = a247595_list !! n

%o a247595_list = 1 : 3 : 10 : map (* 4) (zipWith3 (((+) .) . (-))

%o (drop 2 a247595_list) (tail a247595_list) a247595_list)

%o -- _Reinhard Zumkeller_, Sep 21 2014

%o (Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x +2*x^2)/(1-4*x+4*x^2-4*x^3))); // _G. C. Greubel_, Aug 04 2018

%Y Cf. A061279, A247594.

%K nonn

%O 0,2

%A _Michael Somos_, Sep 20 2014