login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A165902 a(0)=0, a(1)=1, a(n) = a(n-1) + 3^(n-3)*a(n-2). 2

%I #14 Sep 08 2022 08:45:48

%S 0,1,1,2,5,23,158,2021,40415,1513724,89901329,10021444493,

%T 1779549303200,593535825170357,315835356239140757,

%U 315745107820598835194,503859317773076207957705,1510702921925354866376968691,7231341194731242966764145947126

%N a(0)=0, a(1)=1, a(n) = a(n-1) + 3^(n-3)*a(n-2).

%H G. C. Greubel, <a href="/A165902/b165902.txt">Table of n, a(n) for n = 0..85</a>

%p 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

%t 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 *)

%t 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 *)

%o (PARI) a(n)=if(n<2,n,a(n-1)+3^(n-3)*a(n-2));

%o (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

%o (Sage)

%o 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)))

%o [F(n,3) for n in (0..20)] # _G. C. Greubel_, Dec 19 2019

%o (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

%Y Cf. A015460.

%Y q-Fibonacci numbers: A000045 (q=1), A165901 (q=2), this sequence (q=3).

%K nonn

%O 0,4

%A _Jaume Oliver Lafont_, Sep 29 2009

%E a(18) from _Harvey P. Dale_, Oct 18 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 14 05:06 EDT 2024. Contains 374291 sequences. (Running on oeis4.)