login
a(n) = n^2 - floor( n/2 ).
9

%I #50 Mar 14 2024 16:46:07

%S 0,1,3,8,14,23,33,46,60,77,95,116,138,163,189,218,248,281,315,352,390,

%T 431,473,518,564,613,663,716,770,827,885,946,1008,1073,1139,1208,1278,

%U 1351,1425,1502,1580,1661,1743,1828,1914,2003,2093,2186,2280,2377,2475

%N a(n) = n^2 - floor( n/2 ).

%C Quasipolynomial of order 2. - _Charles R Greathouse IV_, Jan 19 2012

%C The binomial transform is 0, 1, 5, 20,... which is A084850 with offset 1. - _R. J. Mathar_, Nov 26 2014

%H Vincenzo Librandi, <a href="/A014848/b014848.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).

%F a(2*n) = A033991(n).

%F a(2*n+1) = A033951(n).

%F G.f.: x*(1+x+2*x^2)/((1-x)^2*(1-x^2)).

%F a(n) = (2*n*(2*n-1) + 1 - (-1)^n)/4. - _Bruno Berselli_, Feb 17 2011

%F a(n) = round(n/(exp(1/n) - 1)), n > 0. - _Richard R. Forberg_, Nov 14 2014

%F E.g.f.: (1/4)*((1 + 2*x + 4*x^2)*exp(x) - exp(-x)). - _G. C. Greubel_, Mar 14 2024

%p A014848:=n->n^2 - floor(n/2); seq(A014848(n), n=0..50); # _Wesley Ivan Hurt_, Oct 11 2013

%t Table[n^2-Floor[n/2],{n,0,100}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 12 2011 *)

%t LinearRecurrence[{2,0,-2,1},{0,1,3,8},60] (* _Harvey P. Dale_, Jun 13 2022 *)

%o (PARI) a(n)=n^2-n\2

%o (Magma) [n^2-Floor(n/2) : n in [0..50]]; // _Wesley Ivan Hurt_, Nov 14 2014

%o (Python)

%o def A014848(n): return n**2-(n>>1) # _Chai Wah Wu_, Jan 18 2023

%o (SageMath) [n^2 - (n//2) for n in range(71)] # _G. C. Greubel_, Mar 14 2024

%Y Cf. A033951, A033991, A042963 (first differences), A084850.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_