OFFSET
0,3
COMMENTS
Quasipolynomial of order 2. - Charles R Greathouse IV, Jan 19 2012
The binomial transform is 0, 1, 5, 20,... which is A084850 with offset 1. - R. J. Mathar, Nov 26 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(2*n) = A033991(n).
a(2*n+1) = A033951(n).
G.f.: x*(1+x+2*x^2)/((1-x)^2*(1-x^2)).
a(n) = (2*n*(2*n-1) + 1 - (-1)^n)/4. - Bruno Berselli, Feb 17 2011
a(n) = round(n/(exp(1/n) - 1)), n > 0. - Richard R. Forberg, Nov 14 2014
E.g.f.: (1/4)*((1 + 2*x + 4*x^2)*exp(x) - exp(-x)). - G. C. Greubel, Mar 14 2024
MAPLE
MATHEMATICA
Table[n^2-Floor[n/2], {n, 0, 100}] (* Vladimir Joseph Stephan Orlovsky, Apr 12 2011 *)
LinearRecurrence[{2, 0, -2, 1}, {0, 1, 3, 8}, 60] (* Harvey P. Dale, Jun 13 2022 *)
PROG
(PARI) a(n)=n^2-n\2
(Magma) [n^2-Floor(n/2) : n in [0..50]]; // Wesley Ivan Hurt, Nov 14 2014
(Python)
def A014848(n): return n**2-(n>>1) # Chai Wah Wu, Jan 18 2023
(SageMath) [n^2 - (n//2) for n in range(71)] # G. C. Greubel, Mar 14 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved