OFFSET
0,2
COMMENTS
Sum of all base-3 numbers with length at most n. - Alois P. Heinz, Feb 23 2020
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (12,-27).
FORMULA
a(n) = C(3^n,2), n>=0. - Zerinvary Lajos, Jan 07 2008
a(n) = 12*a(n-1) - 27*a(n-2), with a(0)=0, a(1)=3. - Harvey P. Dale, Oct 07 2012
From R. J. Mathar, Mar 24 2013: (Start)
G.f.: 3*x/((9*x-1)*(3*x-1)).
a(n) = 3*A016142(n-1). (End)
E.g.f.: exp(6*x)*sinh(3*x). - Elmo R. Oliveira, Mar 11 2026
MAPLE
seq(binomial(3^n, 2), n=0..19); # Zerinvary Lajos, Jan 07 2008
MATHEMATICA
Binomial[3^Range[0, 20], 2] (* or *) LinearRecurrence[{12, -27}, {0, 3}, 30] (* Harvey P. Dale, Oct 07 2012 *)
PROG
(Magma) [3^n*(3^n-1)/2: n in [0..30]]; // Vincenzo Librandi, May 01 2011
(PARI) a(n)=binomial(3^n, 2) \\ Charles R Greathouse IV, Jun 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved
