A229277 Number of ascending runs in {1,...,3}^n.
0, 3, 15, 63, 243, 891, 3159, 10935, 37179, 124659, 413343, 1358127, 4428675, 14348907, 46235367, 148272039, 473513931, 1506635235, 4778186031, 15109399071, 47652720147, 149931729243, 470715894135, 1474909801623, 4613015762523, 14403906360531, 44906296300479
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (6,-9).
Programs
-
Maple
a:= n-> `if`(n=0, 0, 3^(n-1)*(2*n+1)): seq(a(n), n=0..30);
-
Mathematica
a[0] = 0; a[n_] := 3^(n - 1)*(2*n + 1); Array[a, 30, 0] (* Amiram Eldar, May 17 2022 *)
Formula
G.f.: -3*(x-1)*x/(3*x-1)^2.
a(n) = 3^(n-1)*(2*n+1) for n>0, a(0) = 0.
a(n) = 3*A081038(n-1) for n>0.
From Amiram Eldar, May 17 2022: (Start)
Sum_{n>=1} 1/a(n) = 3*(sqrt(3)*arctanh(1/sqrt(3)) - 1).
Sum_{n>=1} (-1)^(n+1)/a(n) = 3 - sqrt(3)*Pi/2. (End)