OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..50
FORMULA
a(n) = ((3^(n-1) + 1)/2) * a(n-1). - Vincenzo Librandi, Nov 11 2012
a(n) ~ c * 3^(n*(n-1)/2) / 2^(n+1), where c = A132323 = QPochhammer(-1, 1/3) = 3.129868... . - Vaclav Kotesovec, Mar 24 2017
MATHEMATICA
Flatten[{1, Table[QPochhammer[-1, 3, n]/2^(n+1), {n, 2, 15}]}] (* Vaclav Kotesovec, Mar 24 2017 *)
a[n_, m_]:= a[n, m]= If[n<3, 1, (m^(n-1)+m-2)*a[n-1, m]/(m-1)];
Table[a[n, 3], {n, 20}] (* G. C. Greubel, Apr 29 2023 *)
PROG
(Magma) [n le 2 select 1 else ((3^(n-1)+1)/2)*Self(n-1): n in [1..15]]; // Vincenzo Librandi, Nov 11 2012
(SageMath)
@CachedFunction # a = A015502
def a(n, m): return 1 if (n<3) else (m^(n-1) + m-2)*a(n-1, m)/(m-1)
[a(n, 3) for n in range(1, 31)] # G. C. Greubel, Apr 29 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved