%I #89 Nov 13 2024 21:02:23
%S 0,2,3,8,10,18,21,32,36,50,55,72,78,98,105,128,136,162,171,200,210,
%T 242,253,288,300,338,351,392,406,450,465,512,528,578,595,648,666,722,
%U 741,800,820,882,903,968,990,1058,1081,1152,1176,1250,1275,1352,1378,1458
%N a(n) = (n + (n mod 2))*(n + 1)/2.
%C Partial sums of A014682. - _Paul Barry_, Mar 31 2008
%C a(n) is the sum of all parts in the integer partitions of n+1 into two parts, see example. - _Wesley Ivan Hurt_, Jan 26 2013
%C Also the independence number of the n X n torus grid graph. - _Eric W. Weisstein_, Sep 06 2017
%C Also the number of circles we can draw on vertices of an (n+1)-sided regular polygon (using only a compass). - _Matej Veselovac_, Jan 21 2020
%D W. R. Hare, S. T. Hedetniemi, R. Laskar, and J. Pfaff, Complete coloring parameters of graphs, Proceedings of the sixteenth Southeastern international conference on combinatorics, graph theory and computing (Boca Raton, Fla., 1985). Congr. Numer., Vol. 48 (1985), pp. 171-178. MR0830709 (87h:05088). See s_m on page 135. - _N. J. A. Sloane_, Apr 06 2012
%H G. C. Greubel, <a href="/A093353/b093353.txt">Table of n, a(n) for n = 0..5000</a>
%H Math StackExchange, <a href="https://math.stackexchange.com/q/3517549">Number of circles on vertices of a regular polygon</a>, 2020.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/IndependenceNumber.html">Independence Number</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TorusGridGraph.html">Torus Grid Graph</a>.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F a(2*n) = a(2*n-1) + n = A014105(n).
%F a(2*n+1) = a(2*n) + 3*n + 2 = A001105(n+1).
%F G.f.: x*(2+x+x^2)/((1-x)^3*(1+x)^2).
%F a(n) = (n+1)*(2*n+1-(-1)^n)/4. - _Paul Barry_, Mar 31 2008
%F a(n) = (n+1)*floor((n+1)/2). - _Wesley Ivan Hurt_, Jan 26 2013
%F a(n) = Sum_{i=1..floor((n+1)/2)} i + Sum_{i=ceiling((n+1)/2)..n} i. - _Wesley Ivan Hurt_, Jun 08 2013
%F From _Amiram Eldar_, Mar 10 2022: (Start)
%F Sum_{n>=1} 1/a(n) = Pi^2/12 + 2*(1-log(2)) = A072691 + A188859.
%F Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/12 - 2*(1-log(2)) = A072691 - A188859. (End)
%F E.g.f.: (x*(3 + x)*cosh(x) + (1 + x)^2*sinh(x))/2. - _Stefano Spezia_, Nov 13 2024
%e a(1) = 2 since 2 = (1+1) and the sum of the first and second parts in the partition is 2; a(2) = 3 since 3 = (1+2) and the sum of these parts is 3; a(3) = 8 since 4 = (1+3) = (2+2) and the sum of all the parts is 8. - _Wesley Ivan Hurt_, Jan 26 2013
%p a:= n-> (n+1)*floor((n+1)/2); seq(a(n), n = 0..70);
%t (* Contributions from _Harvey P. Dale_, Nov 15 2013: Start *)
%t Table[(n+Mod[n,2])*(n+1)/2,{n,0,60}]
%t LinearRecurrence[{1,2,-2,-1,1},{0,2,3,8,10},60]
%t Join[{0},Module[{nn = 60, ab}, ab = Transpose[ Partition[ Accumulate[ Range[nn]], 2]]; Flatten[ Transpose[ {ab[[1]] + Range[nn/2], ab[[2]]}]]]]
%t (* End *)
%o (PARI) a(n)=(n+1)\2*(n+1) \\ _Charles R Greathouse IV_, Jun 11 2015
%o (Magma) [(n+1)*(2*n+1-(-1)^n)/4: n in [0..60]]; // _Vincenzo Librandi_, Jan 23 2020
%o (SageMath) [(n+1)*int((n+1)//2) for n in range(0,71)] # _G. C. Greubel_, Mar 14 2024
%Y Cf. A000217, A001105, A014105, A014682, A072691, A188859, A242669.
%K nonn,easy,changed
%O 0,2
%A _Reinhard Zumkeller_, Apr 27 2004
%E a(0)=0 prepended by _Alois P. Heinz_, Nov 13 2024