OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..85
MAPLE
q:=3; seq(add((product((1-q^(n-j-1-k))/(1-q^(k+1)), k=0..j-1))* q^(j*(j-1)), j = 0..floor((n-1)/2)), n = 0..20); # G. C. Greubel, Dec 19 2019
MATHEMATICA
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==a[n-1]+3^(n-3) a[n-2]}, a, {n, 20}] (* Harvey P. Dale, Oct 18 2014 *)
F[n_, q_]:= Sum[QBinomial[n-j-1, j, q]*q^(j*(j-1)), {j, 0, Floor[(n-1)/2]}]; Table[F[n, 3], {n, 0, 20}] (* G. C. Greubel, Dec 19 2019 *)
PROG
(PARI) a(n)=if(n<2, n, a(n-1)+3^(n-3)*a(n-2));
(Magma) q:=3; I:=[0, 1]; [n le 2 select I[n] else Self(n-1) + q^(n-3)*Self(n-2): n in [1..20]]; // G. C. Greubel, Dec 19 2019
(Sage)
def F(n, q): return sum( q_binomial(n-j-1, j, q)*q^(j*(j-1)) for j in (0..floor((n-1)/2)))
[F(n, 3) for n in (0..20)] # G. C. Greubel, Dec 19 2019
(GAP) q:=3;; a:=[0, 1];; for n in [3..20] do a[n]:=a[n-1]+q^(n-3)*a[n-2]; od; a; # G. C. Greubel, Dec 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaume Oliver Lafont, Sep 29 2009
EXTENSIONS
a(18) from Harvey P. Dale, Oct 18 2014
STATUS
approved