OFFSET
0,2
COMMENTS
The rational function A_n = (a_0)/5 * (8 - 3(4/9)^n) where a_0=1 in the Wikipedia link below equals A_n = 1/9^n*a(n).
LINKS
Wikipedia, Koch snowflake
Index entries for linear recurrences with constant coefficients, signature (13,-36).
FORMULA
G.f.: (1-x) / ((1-4*x)*(1-9*x)).
a(n) = 13*a(n-1) - 36*a(n-2) for n>1, a(0)=1, a(1)=12.
a(n) = (8*9^n-3*4^n)/5.
EXAMPLE
a(1) = 9+3 = 12, because an equilateral triangle can be cut up into 9 triangles with side length one-third and 3 further triangles are stacked onto the three central side pieces.
MAPLE
L:=[1, 12]: for k from 3 to 34 do: L:=[op(L), 13*L[k-1]-36*L[k-2]]: od: print(L);
MATHEMATICA
Table[1/5*(8*9^n - 3*4^n), {n, 0, 20}] (* or *)
CoefficientList[Series[(1 - x)/((1 - 4 x) (1 - 9 x)), {x, 0, 20}], x] (* Michael De Vlieger, Nov 10 2016 *)
LinearRecurrence[{13, -36}, {1, 12}, 30] (* Harvey P. Dale, Feb 26 2023 *)
PROG
(PARI) Vec((1-x)/((1-4*x)*(1-9*x)) + O(x^30)) \\ Colin Barker, Oct 19 2016
(Magma) [(8*9^n-3*4^n)/5 : n in [0..30]]; // Wesley Ivan Hurt, Apr 11 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Dintle N Kagiso, Oct 17 2016
STATUS
approved