%I M4508 #51 Sep 08 2022 08:44:33
%S 1,8,31,85,190,360,610,956,1415,2005,2745,3655,4756,6070,7620,9430,
%T 11525,13931,16675,19785,23290,27220,31606,36480,41875,47825,54365,
%U 61531,69360,77890,87160,97210,108081,119815,132455,146045,160630
%N Number of ways in which n identical balls can be distributed among 5 boxes in a row such that each pair of adjacent boxes contains at least 4 balls.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Vincenzo Librandi, <a href="/A005338/b005338.txt">Table of n, a(n) for n = 8..1000</a>
%H D. R. Breach, <a href="/A004120/a004120.pdf">Letter to N. J. A. Sloane, Jun 1980</a>
%H Philippe Flajolet, <a href="http://algo.inria.fr/libraries/autocomb/balls-html/balls.html">Balls and Urns, etc.</a>, A problem in submarine detection (solution to problem 68-16).
%H M. Hayes (proposer) and D. R. Breach (solver), <a href="https://doi.org/10.1137/1012060">A combinatorial problem, Problem 68-16</a>, SIAM Rev. 12 (1970), 294-297.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F G.f.: x^8*(1 + 3*x + x^2 - 11*x^5 + 7*x^6)/(1 - x)^5. - _Vladeta Jovovic_, Apr 13 2008
%F a(n) = (n^4 + 10*n^3 - 445*n^2 + 2690*n - 1656)/24 for n > 9. - _Colin Barker_, May 10 2012
%t f[x_] := x^8*(1 + 3*x + x^2 - 11*x^5 + 7*x^6)/(1 - x)^5; Drop[ CoefficientList[ Series[f[x], {x, 0, 44}], x], 8] (* _Jean-François Alcover_, Oct 05 2011, after _Vladeta Jovovic_ *)
%t LinearRecurrence[{5,-10,10,-5,1},{1,8,31,85,190,360,610},40] (* _Harvey P. Dale_, Aug 26 2019 *)
%o (Magma) I:=[1, 8, 31, 85, 190, 360, 610]; [n le 7 select I[n] else 5*Self(n-1)-10*Self(n-2)+10*Self(n-3)-5*Self(n-4)+Self(n-5): n in [1..40]]; // _Vincenzo Librandi_, May 11 2012
%Y Cf. A005337, A005339, A005340.
%K nonn,easy
%O 8,2
%A _N. J. A. Sloane_
%E Corrected and extended by _Vladeta Jovovic_, Apr 13 2008
%E Name clarified by _Alois P. Heinz_, Oct 02 2017