login
A251701
a(n) = 3^n + n^2.
1
1, 4, 13, 36, 97, 268, 765, 2236, 6625, 19764, 59149, 177268, 531585, 1594492, 4783165, 14349132, 43046977, 129140452, 387420813, 1162261828, 3486784801, 10460353644, 31381060093, 94143179356, 282429537057, 847288610068, 2541865829005, 7625597485716
OFFSET
0,2
FORMULA
G.f.: (1-2*x+x^2-4*x^3)/((1-3*x)*(1-x)^3).
a(n) = 6*a(n-1)-12*a(n-2)+10*a(n-3)-3*a(n-4) for n>3.
a(n) = A000244(n) + A000290(n).
MAPLE
A251701:=n->3^n + n^2: seq(A251701(n), n=0..40); # Wesley Ivan Hurt, Jan 22 2017
MATHEMATICA
Table[3^n + n^2, {n, 0, 40}] (* or *) CoefficientList[Series[(1 - 2 x + x^2 - 4 x^3) / ((1 - 3 x) (1 - x)^3), {x, 0, 40}], x]
LinearRecurrence[{6, -12, 10, -3}, {1, 4, 13, 36}, 30] (* Harvey P. Dale, Aug 08 2017 *)
PROG
(Magma) [3^n+n^2: n in [0..30]] /* or */ I:=[1, 4, 13, 36]; [n le 4 select I[n] else 6*Self(n-1)-12*Self(n-2)+10*Self(n-3)-3*Self(n-4): n in [1..30]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Dec 07 2014
STATUS
approved