|
|
A099568
|
|
Expansion of (1-x)/((1-2*x)*(1-x-x^3)).
|
|
2
|
|
|
1, 2, 4, 9, 19, 39, 80, 163, 330, 666, 1341, 2695, 5409, 10846, 21733, 43526, 87140, 174409, 349007, 698291, 1396988, 2794571, 5590014, 11181306, 22364485, 44731715, 89467453, 178940802, 357890245, 715793154, 1431604868, 2863236937
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Row sums of number triangle A099567.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-3) - 2*a(n-4).
a(n) = Sum_{k=0..n} Sum_{j=0..floor(n/3)} binomial(n-2*j, k+j).
|
|
MATHEMATICA
|
LinearRecurrence[{3, -2, 1, -2}, {1, 2, 4, 9}, 40] (* G. C. Greubel, Jul 26 2022 *)
|
|
PROG
|
(PARI) Vec((1-x)/((1-2*x)*(1-x-x^3)) + O(x^40)) \\ Michel Marcus, Oct 18 2016
(Magma) [n le 4 select Round(9^((n-1)/3)) else 3*Self(n-1) -2*Self(n-2) +Self(n-3) -2*Self(n-4): n in [1..41]]; // G. C. Greubel, Jul 26 2022
(SageMath)
@CachedFunction
if (n<4): return round(9^(n/3))
else: return 3*a(n-1) -2*a(n-2) + a(n-3) - 2*a(n-4)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|