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.

Showing 1-2 of 2 results.

A281912 Number of sequences of balls colored with at most n colors such that exactly one ball is of a color seen earlier in the sequence.

Original entry on oeis.org

1, 8, 57, 424, 3425, 30336, 294553, 3123632, 36003969, 448816600, 6022033721, 86587079448, 1328753602657, 21683227579664, 375013198304025, 6853321766162656, 131976208783240193, 2671430511854158632, 56709161712552286009, 1259836187316759240200
Offset: 1

Views

Author

Jeremy Dover, Feb 01 2017

Keywords

Comments

Note that any such sequence has at least 2 balls, and at most n+1
Number of sequences of balls colored with at most n colors such that exactly two balls are the same color as some other ball in the sequence (necessarily each other). - Jeremy Dover, Sep 26 2017

Examples

			n=1 => AA -> a(1) = 1.
n=2 => AA,BB,AAB,ABA,BAA,BBA,BAB,ABB -> a(2) = 8.
		

Crossrefs

Cf. A093964.
Row sums of triangle A281881. - Jeremy Dover, Sep 26 2017

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<2, 1, a(n-1)*(n+2)/(n-1)-a(n-2))*n
        end:
    seq(a(n), n=1..25);  # Alois P. Heinz, Feb 02 2017
  • Mathematica
    Table[n!*Sum[Binomial[k, 2]/(n + 1 - k)!, {k, 2, n + 1}], {n, 20}] (* Michael De Vlieger, Feb 02 2017 *)

Formula

a(n) = n! * Sum_{k=2..n+1} binomial(k,2)/(n+1-k)!.
a(n) = n if n < 2, a(n) = n*((n+2)/(n-1)*a(n-1) - a(n-2)) for n >= 2. - Alois P. Heinz, Feb 02 2017
a(n)/n! ~ e*n^2/2. - Vaclav Kotesovec, Feb 03 2017

A281944 Triangle read by rows: T(n,k) (n>=1, 3<=k<=n+2) is the number of k-sequences of balls colored with n colors such that exactly two balls are of a color seen previously in the sequence.

Original entry on oeis.org

1, 2, 14, 3, 42, 150, 4, 84, 600, 1560, 5, 140, 1500, 7800, 16800, 6, 210, 3000, 23400, 100800, 191520, 7, 294, 5250, 54600, 352800, 1340640, 2328480, 8, 392, 8400, 109200, 940800, 5362560, 18627840, 30240000, 9, 504, 12600, 196560, 2116800, 16087680, 83825280, 272160000, 419126400, 10, 630, 18000, 327600, 4233600, 40219200, 279417600, 1360800000, 4191264000, 6187104000
Offset: 1

Views

Author

Jeremy Dover, Feb 02 2017

Keywords

Examples

			n=1 => AAA -> T(1,3)=1
n=2 => AAA,BBB -> T(2,3)=2
   AAAB,AABA,ABAA,BAAA,BBBA,BBAB,BABB,ABBB,AABB,ABAB,ABBA,BAAB,BABA,BBAA -> T(2,4)=14
Triangle starts:
   1
   2,  14
   3,  42,   150
   4,  84,   600,   1560
   5, 140,  1500,   7800,   16800
   6, 210,  3000,  23400,  100800,   191520
   7, 294,  5250,  54600,  352800,  1340640,  2328480
   8, 392,  8400, 109200,  940800,  5362560, 18627840,  30240000
   9, 504, 12600, 196560, 2116800, 16087680, 83825280, 272160000, 419126400
		

Crossrefs

Columns of table: T(n,3) = A000027(n), T(n,4) = A163756(n).
Other sequences in table: T(n,n+2) = A037960(n).

Programs

  • Mathematica
    Table[(Binomial[k, 3] + 3 Binomial[k, 4]) n!/(n + 2 - k)!, {n, 12}, {k, 3, n + 2}] // Flatten (* Michael De Vlieger, Feb 05 2017 *)
  • PARI
    T(n, k) = (binomial(k,3) + 3*binomial(k,4)) * n! / (n+2-k)!;
    tabl(nn) = for (n=1, nn, for (k=3, n+2, print1(T(n,k), ", ")); print()); \\ Michel Marcus, Feb 04 2017

Formula

T(n, k) = (binomial(k,3) + 3*binomial(k,4)) * n! / (n+2-k)!.
T(n, k) = n*T(n-1,k-1) + (k-2)*A281881(n,k-1).
Showing 1-2 of 2 results.