OFFSET
0,3
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-14,16,-8).
FORMULA
MATHEMATICA
LinearRecurrence[{6, -14, 16, -8}, {0, 1, 6, 22}, 30] (* Harvey P. Dale, Mar 22 2018 *)
PROG
(Magma) I:=[0, 1, 6, 22]; [n le 4 select I[n] else 6*Self(n-1) -14*Self(n-2) +16*Self(n-3) -8*Self(n-4): n in [1..51]]; // G. C. Greubel, Apr 20 2023
(SageMath)
@CachedFunction
def a(n): # a = A099855
if (n<5): return (0, 1, 6, 22, 64)[n]
else: return 6*a(n-1) - 14*a(n-2) + 16*a(n-3) - 8*a(n-4)
[a(n) for n in range(51)] # G. C. Greubel, Apr 20 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 28 2004
STATUS
approved