OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Mircea Merca, Inequalities and Identities Involving Sums of Integer Functions J. Integer Sequences, Vol. 14 (2011), Article 11.9.1.
Index entries for linear recurrences with constant coefficients, signature (3,-1,3).
FORMULA
a(n) = round(3^(n+1)/10).
a(n) = floor((3*3^n + 3)/10).
a(n) = ceiling((3*3^n - 3)/10).
a(n) = a(n-4) + 8*3^(n-3), n > 3.
a(n) = 3*a(n-1) - a(n-2) + 3*a(n-3), n > 2.
G.f.: x/((1-3*x)*(1+x^2)).
a(n) = 3^(n+1)/10 - (-1)^n* A112030(n)/10. - R. J. Mathar, Jan 08 2011
EXAMPLE
a(4) = round(1/5) + round(3/5) + round(9/5) + round(27/5) + round(81/5) = 0 + 1 + 2 + 5 + 16 = 24.
MAPLE
seq(round(3^n/10), n=1..25);
MATHEMATICA
Accumulate[Floor[3^Range[0, 30]/5+1/2]] (* Harvey P. Dale, Jul 02 2011 *)
PROG
(Magma) [Round(3^(n+1)/10): n in [0..40]]; // Vincenzo Librandi, Jun 21 2011
(PARI) vector(40, n, n--; (3*(3^n +1)/10)\1) \\ G. C. Greubel, Jan 30 2019
(Sage) [floor(3*(3^n+1)/10) for n in range(40)] # G. C. Greubel, Jan 30 2019
CROSSREFS
KEYWORD
nonn,less,easy
AUTHOR
Mircea Merca, Dec 28 2010
STATUS
approved