%I #35 Oct 05 2022 05:05:51
%S 0,1,-16,-318,-1895,-6936,-19313,-45055,-92831,-174433,-305249,
%T -504751,-796967,-1210969,-1781345,-2548687,-3560063,-4869505,
%U -6538481,-8636383,-11240999,-14439001,-18326417,-23009119,-28603295,-35235937,-43045313,-52181455,-62806631,-75095833,-89237249
%N a(n) = floor(f(n)), where f(n) = n^4*(15-24*n+10*n^2) + 20*n^5*(1-n)^3 / (1-2*n(1-n)).
%C Sandefur shows that if the probability of winning any particular point in a tennis match is p, the fraction of the games won would be f(p).
%H James Sandefur, <a href="https://www.jstor.org/stable/30044857">A Geometric Series from Tennis</a>, The College Mathematics Journal, Vol. 36, No. 3 (May, 2005), pp. 224-226.
%F a(n) = g(n) + h(n), where g(n) = floor(n^2 * (-4*n^3 + 10*n^2 - 5*n - 5/2) + 1) and h(n) = [1 if n=0; 2 if n=1; -1 if n=3,5,6; 0 if n=4 or n>6]
%t a[n_] := Floor[n^4*(15 - 24*n + 10 n^2) + 20*n^5*(1 - n)^3/(1 - 2*n*(1 - n))]; Array[a, 30, 0] (* _Amiram Eldar_, Aug 12 2022 *)
%o (Python)
%o def a(n):
%o return n**4 * (15-24*n+10*n**2) + 20*n**5 * (1-n)**3 // (1-2*n*(1-n))
%K sign
%O 0,3
%A _Christoph B. Kassir_, Aug 12 2022