A366314 a(n) = a(n-1) + 3*a(n-2) + 9*a(n-3) with a(0)=0, a(1)=1, a(2)=4.
0, 1, 4, 7, 28, 85, 232, 739, 2200, 6505, 19756, 59071, 176884, 531901, 1594192, 4781851, 14351536, 43044817, 129136084, 387434359, 1162245964, 3486773797, 10460420920, 31380955987, 94143182920, 282429839161, 847287991804, 2541866155567, 7625598683428, 22876789076365, 68630380526752
Offset: 0
Examples
Starting with initial terms of x, y, z, the sequence proceeds: (z + y + x)/3 (4z + 4y +x)/9 (16z + 7y + 4x)/27 (37z + 28y + 16x)/81 (121z + 85y + 37x)/243 ....
Links
- Paolo Xausa, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,3,9).
Crossrefs
Cf. A103770.
Programs
-
Maple
a:= proc(n) option remember; if n < 3 then n^2 else a(n-1)+3*a(n-2)+9*a(n-3) fi end: seq(a(n), n=0..30);
-
Mathematica
LinearRecurrence[{1,3,9},{0,1,4},50] (* Paolo Xausa, Nov 14 2023 *)
Formula
From Stefano Spezia, Oct 15 2023: (Start)
G.f.: x*(1 + 3*x)/((1 - 3*x)*(1 + 2*x + 3*x^2)).
a(n) = (4*3^n + (-2 - sqrt(2)*i)*(-1 - sqrt(2)*i)^n + i*(-1 + sqrt(2)*i)^n*(2*i + sqrt(2)))/12, where i denotes the imaginary unit. (End)
Comments