A264750 Number of sequences of 5 throws of an n-sided die (with faces numbered 1, 2, ..., n) in which the sum of the throws first reaches or exceeds n on the 5th throw.
5, 29, 99, 259, 574, 1134, 2058, 3498, 5643, 8723, 13013, 18837, 26572, 36652, 49572, 65892, 86241, 111321, 141911, 178871, 223146, 275770, 337870, 410670, 495495, 593775, 707049, 836969, 985304, 1153944, 1344904, 1560328, 1802493, 2073813, 2376843, 2714283
Offset: 5
Examples
From _Jon E. Schoenfield_, Nov 26 2015: (Start) For n=5, the a(5) = 5 sequences (i.e., quintuples or 5-tuples) are {1,1,1,1,1}, {1,1,1,1,2}, {1,1,1,1,3}, {1,1,1,1,4} and {1,1,1,1,5}. (Each of the first four throws must be a 1; otherwise, the sum of the throws would reach or exceed 5 before the 5th throw.) For n=6, each of the quintuples must have four throws whose sum is less than 6, followed by a fifth throw that brings the sum to at least 6, so the a(6) = 29 quintuples are the 5 quintuples {1,1,1,1,t_5} where t_5 is any value in 2..6 and the four sets of 6 quintuples {1,1,1,2,t_5}, {1,1,2,1,t_5}, {1,2,1,1,t_5} and {2,1,1,1,t_5} where t_5 is any value in 1..6. (End)
Links
- Colin Barker, Table of n, a(n) for n = 5..1000
- Louis Rogliano, Sequence A264750
- Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
Programs
-
Magma
[(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120: n in [5..40]]; // Vincenzo Librandi, Nov 24 2015
-
Maple
A264750:=n->(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120: seq(A264750(n), n=5..50); # Wesley Ivan Hurt, Nov 24 2015
-
Mathematica
f[n_, k_] := Module[ {i, total = 0, part, perm}, part = IntegerPartitions[n, {k}]; perm = Flatten[Table[Permutations[part[[i]]], {i, 1, Length[part]}], 1]; For[i = 1, i <= Length[perm], i++, total += n + 1 - perm[[i, k]] ]; Return[total]; ] And the sequences are obtained by: h[k_] := Table[f[i, k], {i, k, number_of_terms_wanted}] Table[(n - 4) (n - 3) (n - 2) (n - 1) (4 n + 5)/120, {n, 5, 40}] (* Bruno Berselli, Nov 24 2015 *)
-
PARI
Vec(x^5*(5-x)/(1-x)^6 + O(x^100)) \\ Colin Barker, Nov 23 2015
-
PARI
for(n=5, 40, print1((n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120", ")); \\ Bruno Berselli, Nov 24 2015
-
Sage
[(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120 for n in (5..40)] # Bruno Berselli, Nov 24 2015
Formula
From Colin Barker, Nov 23 2015: (Start)
a(n) = (n - 4)*(n - 3)*(n - 2)*(n - 1)*(4*n + 5)/120.
a(n) = 6*a(n-1) - 15*a(n-2) + 20*a(n-3) - 15*a(n-4) + 6*a(n-5) - a(n-6) for n>10.
G.f.: x^5*(5 - x) / (1 - x)^6. (End)
Extensions
Offset changed by Robert Israel, Nov 25 2015
Formulae, b-file adapted to the new offset and definition rephrased by the Editors of the OEIS, Nov 26 2015
Comments