OFFSET
0,2
COMMENTS
Sum of reciprocals = 1.308346570619799777189561356..
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (7, -15, 9).
FORMULA
a(n) = 1/4 * ((6*n-3)*3^n + 7).
a(n) = 6*a(n-1)-8*a(n-2)-6*a(n-3)+9*a(n-4) for n>3. - Colin Barker, Jun 13 2015
G.f.: -(9*x^2-3*x+1) / ((x-1)*(3*x-1)^2). - Colin Barker, Jun 13 2015
EXAMPLE
3*3^3 + 2*3^2 + 3 + 1 = 103.
MATHEMATICA
LinearRecurrence[{6, -8, -6, 9}, {1, 4, 22, 103}, 50] (* Vincenzo Librandi, Jun 14 2015 *)
LinearRecurrence[{7, -15, 9}, {1, 4, 22}, 26] (* Ray Chandler, Aug 03 2015 *)
PROG
(PARI) trajpolypn(n1, k) = { s=0; for(x1=0, n1, y1 = polypn2(k, x1); print1(y1", "); s+=1.0/y1; ); print(); print(s) }
polypn2(n, p) = { x=n; y=1; for(m=1, p, y=y+m*x^m; ); return(y) }
(PARI) Vec(-(9*x^2-3*x+1)/((x-1)*(3*x-1)^2) + O(x^100)) \\ Colin Barker, Jun 13 2015
(Magma) [1/4 * ((6*n-3)*3^n + 7): n in [0..30]]; // Vincenzo Librandi, Jun 14 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Cino Hilliard, Nov 20 2003
STATUS
approved