cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Louis Rogliano

Louis Rogliano's wiki page.

Louis Rogliano has authored 3 sequences.

A306262 Difference between maximum and minimum sum of products of successive pairs in permutations of [n].

Original entry on oeis.org

0, 0, 0, 4, 11, 24, 42, 68, 101, 144, 196, 260, 335, 424, 526, 644, 777, 928, 1096, 1284, 1491, 1720, 1970, 2244, 2541, 2864, 3212, 3588, 3991, 4424, 4886, 5380, 5905, 6464, 7056, 7684, 8347, 9048, 9786, 10564, 11381, 12240, 13140, 14084, 15071, 16104, 17182
Offset: 0

Author

Louis Rogliano, Feb 01 2019

Keywords

Examples

			a(4) = 11 = 23 - 12. 1342 and 2431 have sums 23, 3214 and 4123 have sums 12.
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 0, (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>,
        <0|0|0|0|1>, <-1|3|-2|-2|3>>^n. <<1, 0, 0, 4, 11>>)[1, 1]):
    seq(a(n), n=0..50);  # Alois P. Heinz, Feb 02 2019
  • Mathematica
    a[n_] := Module[
      {min, max, perm, g, mperm},
      perm = Permutations[Range[n]];
      g[x_] := Sum[x[[i]] x[[i + 1]], {i, 1, Length[x] - 1}];
      mperm = Map[g, perm];
      min = Min[mperm];
      max = Max[mperm];
      Return[max - min]]
    LinearRecurrence[{3,-2,-2,3,-1},{0,0,0,4,11,24},60] (* Harvey P. Dale, Aug 05 2020 *)
  • PARI
    concat([0,0,0], Vec(x^3*(4 - x - x^2) / ((1 - x)^4*(1 + x)) + O(x^40))) \\ Colin Barker, Feb 05 2019

Formula

a(n+1) = a(n) + 1/4*((-1+(-1)^(n-1))^2+2*(n-1)*(n+4)) with a(n) = 0 for n <= 2.
From Alois P. Heinz, Feb 01 2019: (Start)
G.f.: -(x^2+x-4)*x^3/((x+1)*(x-1)^4).
a(n) = (2*n^3+6*n^2-26*n+15-3*(-1)^n)/12 for n > 0.
a(n) = A101986(n-1) - A026035(n) for n > 0. (End)
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5). - Wesley Ivan Hurt, May 28 2021
a(n) = A110610(n+1) - A110611(n+1). - Talmon Silver, Sep 24 2025

Extensions

More terms from Alois P. Heinz, Feb 01 2019

A264751 Triangle read by rows: T(n,k) is the number of sequences of k <= n 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 k-th throw.

Original entry on oeis.org

1, 1, 2, 1, 5, 3, 1, 9, 11, 4, 1, 14, 26, 19, 5, 1, 20, 50, 55, 29, 6, 1, 27, 85, 125, 99, 41, 7, 1, 35, 133, 245, 259, 161, 55, 8, 1, 44, 196, 434, 574, 476, 244, 71, 9, 1, 54, 276, 714, 1134, 1176, 804, 351, 89, 10, 1, 65, 375, 1110, 2058, 2562, 2190, 1275, 485, 109, 11
Offset: 1

Author

Louis Rogliano, Nov 26 2015

Keywords

Comments

By empirical observation: Sum of rows is A002064.

Examples

			Triangle begins:
  1
  1    2
  1    5    3
  1    9   11    4
  1   14   26   19    5
  1   20   50   55   29    6
  1   27   85  125   99   41    7
  1   35  133  245  259  161   55    8
  1   44  196  434  574  476  244   71    9
  1   54  276  714 1134 1176  804  351   89   10
  1   65  375 1110 2058 2562 2190 1275  485  109   11
		

Crossrefs

Columns are: A000012 (k=1), A000096 (k=2), A051925 (k=3), A215862 (k=4), A264750 (k=5).
Cf. A007318 (binomial(n-1,k-1) = number of sequences of k throws of an n-sided die in which the sum of the throws equals n).
See also A002064.

Programs

  • Mathematica
    T[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];   ]
    (* The rows are obtained by: *)
    g[n_] := Table[T[n,k], {k,1,n}]
    (* And the triangle is obtained by: *)
    Table[g[n],{n,1,number_of_rows_wanted}]

Formula

Sum_{k = 1..n} T(n,k)*k/n^k = ((n+1)/n)^(n-1) = expected value of k.
Lim_{n->infinity} (expected value of k) = e = 2.71828182845... - Jon E. Schoenfield, Nov 26 2015
T(n,k) = Sum_{i=k..n} i*binomial(i-2,k-2). - Danny Rorabaugh, Mar 04 2016
T(n,n-1) = 2*T(n-1,n-1) + T(n-1,n-2).
By empirical observation, g.f. for column k: (x-k)/(x-1)^(k+1).

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.

Original entry on oeis.org

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

Author

Louis Rogliano, Nov 23 2015

Keywords

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

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)
		

Crossrefs

Cf. A000096 (k=2), A051925 (k=3), A215862 (k=4).
Cf. A185508.

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