A259821 a(n) = floor( (3^n+1)^2/3^n ).
4, 5, 11, 29, 83, 245, 731, 2189, 6563, 19685, 59051, 177149, 531443, 1594325, 4782971, 14348909, 43046723, 129140165, 387420491, 1162261469, 3486784403, 10460353205, 31381059611, 94143178829, 282429536483
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Kival Ngaokrajang, Illustration of initial terms
- Index entries for linear recurrences with constant coefficients, signature (4,-3).
Programs
-
Mathematica
Table[Floor[(3^n + 1)^2/3^n], {n, 0, 30}] (* Michael De Vlieger, Jul 07 2015 *) LinearRecurrence[{4,-3},{4,5,11},30] (* Harvey P. Dale, Sep 30 2024 *)
-
PARI
a(n)=floor((3^n+1)^2/3^n) for (n=0, 100, print1(a(n),", "))
-
PARI
Vec((3*x^2-11*x+4)/((x-1)*(3*x-1)) + O(x^100)) \\ Colin Barker, Jul 07 2015
Formula
From Colin Barker, Jul 07 2015: (Start)
a(n) = 3^n + 2 for n>0.
a(n) = 4*a(n-1) - 3*a(n-2) for n>2.
G.f.: (3*x^2-11*x+4) / ((x-1)*(3*x-1)).
(End)
Comments