login
A088581
a(n) = n*x^n + (n-1)*x^(n-1) + . . . + x + 1 for x=3.
2
1, 4, 22, 103, 427, 1642, 6016, 21325, 73813, 250960, 841450, 2790067, 9167359, 29893558, 96855124, 312088729, 1000836265, 3196219036, 10169787838, 32252755711, 101988443731, 321655860994, 1012039172392, 3177332285413, 9955641160957, 31137856397032
OFFSET
0,2
COMMENTS
Sum of reciprocals = 1.308346570619799777189561356..
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
Sequence in context: A007901 A368289 A254861 * A017970 A220740 A099013
KEYWORD
nonn,easy
AUTHOR
Cino Hilliard, Nov 20 2003
STATUS
approved