OFFSET
1,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (2, 2, -2, 1).
FORMULA
G.f.: (x^2-x)/(x^4-2*x^3+2*x^2+2*x-1).
a(n) = 2*a(n-1) + 2*a(n-2) - 2*a(n-3) + a(n-4), n > 4.
EXAMPLE
Illustration of a(1)=a(2)=1:
. .__.
| .__|
| |__
| .__|
Illustration of a(3)=4:
.__.__. . .__. . .__. .__.__.
.__.__| |__| | | | | .__. |
|__.__. .__. | |__| | | | |
.__.__| | |__| .__.__| | |__|
MATHEMATICA
LinearRecurrence[{2, 2, -2, 1}, {1, 1, 4, 8}, 30] (* T. D. Noe, Nov 06 2013 *)
PROG
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; 1, -2, 2, 2]^(n-1)*[1; 1; 4; 8])[1, 1] \\ Charles R Greathouse IV, May 16 2026
CROSSREFS
KEYWORD
nonn,walk,easy
AUTHOR
Sean A. Irvine, Nov 17 2010
EXTENSIONS
G.f. formula reverted to the original (correct) value by Stefan Bühler, Nov 06 2013
STATUS
approved
