OFFSET
5,1
COMMENTS
Sequence gives the second column of A185508. [Bruno Berselli, Nov 24 2015]
Number of 5-tuples (t_1, ..., t_5) with 1 <= t_j <= n, Sum_{j <= 4} t_j < n and Sum_{j<=5} t_j >= n. - Robert Israel, Nov 25 2015
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).
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)
EXAMPLE
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)
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 *)
PROG
(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
(Magma) [(n-4)*(n-3)*(n-2)*(n-1)*(4*n+5)/120: n in [5..40]]; // Vincenzo Librandi, 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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Louis Rogliano, Nov 23 2015
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
STATUS
approved