This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A366314 #24 Nov 14 2023 03:24:21 %S A366314 0,1,4,7,28,85,232,739,2200,6505,19756,59071,176884,531901,1594192, %T A366314 4781851,14351536,43044817,129136084,387434359,1162245964,3486773797, %U A366314 10460420920,31380955987,94143182920,282429839161,847287991804,2541866155567,7625598683428,22876789076365,68630380526752 %N A366314 a(n) = a(n-1) + 3*a(n-2) + 9*a(n-3) with a(0)=0, a(1)=1, a(2)=4. %C A366314 This sequence could be considered a companion sequence to A103770, in that both sequences are manifested in the averaging of a Tribonacci sequence with initial seeds of x, y, z. %C A366314 If f(n) is a third order recurrence with f(0)=x, f(1)=y, f(2)=z, and f(n) = (f(n-1)+f(n-2)+f(n-3))/3,n>2, then %C A366314 f(n) =(A103770(n-2)*z + a(n-1)*y + A103770(n-3)x)/3^(n-2). %C A366314 In the general case, these "averaging" sequences will approach a limit of (x+2*y+3*z)/6. %C A366314 a(n) mod 9 repeats [1,4,7] from offset 1 = A100402(n-1)... %H A366314 Paolo Xausa, <a href="/A366314/b366314.txt">Table of n, a(n) for n = 0..1000</a> %H A366314 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,9). %F A366314 From _Stefano Spezia_, Oct 15 2023: (Start) %F A366314 G.f.: x*(1 + 3*x)/((1 - 3*x)*(1 + 2*x + 3*x^2)). %F A366314 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) %e A366314 Starting with initial terms of x, y, z, the sequence proceeds: %e A366314 (z + y + x)/3 %e A366314 (4z + 4y +x)/9 %e A366314 (16z + 7y + 4x)/27 %e A366314 (37z + 28y + 16x)/81 %e A366314 (121z + 85y + 37x)/243 %e A366314 .... %p A366314 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); %t A366314 LinearRecurrence[{1,3,9},{0,1,4},50] (* _Paolo Xausa_, Nov 14 2023 *) %Y A366314 Cf. A103770. %K A366314 nonn,easy %O A366314 0,3 %A A366314 _Gary Detlefs_, Oct 06 2023