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.

Previous Showing 11-20 of 73 results. Next

A074650 Table T(n,k) read by downward antidiagonals: number of Lyndon words (aperiodic necklaces) with n beads of k colors, n >= 1, k >= 1.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 4, 3, 2, 0, 5, 6, 8, 3, 0, 6, 10, 20, 18, 6, 0, 7, 15, 40, 60, 48, 9, 0, 8, 21, 70, 150, 204, 116, 18, 0, 9, 28, 112, 315, 624, 670, 312, 30, 0, 10, 36, 168, 588, 1554, 2580, 2340, 810, 56, 0, 11, 45, 240, 1008, 3360, 7735, 11160, 8160, 2184, 99, 0
Offset: 1

Views

Author

Christian G. Bower, Aug 28 2002

Keywords

Comments

D. E. Knuth uses the term 'prime strings' for Lyndon words because of the fundamental theorem stating the unique factorization of strings into nonincreasing prime strings (see Knuth 7.2.1.1). With this terminology T(n,k) is the number of k-ary n-tuples (a_1,...,a_n) such that the string a_1...a_n is prime. - Peter Luschny, Aug 14 2012
Also, for k a power of a prime, the number of monic irreducible polynomials of degree n over GF(k). - Andrew Howroyd, Dec 23 2017
An equivalent description: Array read by antidiagonals: T(n,k) = number of conjugacy classes of primitive words of length k >= 1 over an alphabet of size n >= 1.
There are a few incorrect values in Table 1 in the Perrin-Reutenauer paper (Christophe Reutenauer, personal communication), see A294438. - Lars Blomberg, Dec 05 2017
The fact that T(3,4) = 20 coincides with the number of the amino acids encoded by DNA made Francis Crick, John Griffith and Leslie Orgel conjecture in 1957 that the genetic code is a comma-free code, which later turned out to be false. [Hayes] - Andrey Zabolotskiy, Mar 24 2018

Examples

			T(4, 3) counts the 18 ternary prime strings of length 4 which are: 0001, 0002, 0011, 0012, 0021, 0022, 0102, 0111, 0112, 0121, 0122, 0211, 0212, 0221, 0222, 1112, 1122, 1222.
Square array starts:
  1,  2,   3,    4,     5,     6,      7, ...
  0,  1,   3,    6,    10,    15,     21, ...
  0,  2,   8,   20,    40,    70,    112, ...
  0,  3,  18,   60,   150,   315,    588, ...
  0,  6,  48,  204,   624,  1554,   3360, ...
  0,  9, 116,  670,  2580,  7735,  19544, ...
  0, 18, 312, 2340, 11160, 39990, 117648, ...
  ...
The transposed array starts:
   1  0  0     0     0      0       0        0         0          0,
   2  1  2     3     6      9      18       30        56         99,
   3  3  8    18    48    116     312      810      2184       5880,
   4  6  20   60   204    670    2340     8160     29120     104754,
   5 10  40  150   624   2580   11160    48750    217000     976248,
   6 15  70  315  1554   7735   39990   209790   1119720    6045837,
   7 21 112  588  3360  19544  117648   720300   4483696   28245840,
   8 28 168 1008  6552  43596  299592  2096640  14913024  107370900,
   9 36 240 1620 11808  88440  683280  5380020  43046640  348672528,
  10 45 330 2475 19998 166485 1428570 12498750 111111000  999989991,
  11 55 440 3630 32208 295020 2783880 26793030 261994040 2593726344,
  12 66 572 5148 49764 497354 5118828 53745120 573308736 6191711526,
  ...
The initial antidiagonals are:
   1
   2  0
   3  1   0
   4  3   2    0
   5  6   8    3    0
   6 10  20   18    6     0
   7 15  40   60   48     9     0
   8 21  70  150  204   116    18     0
   9 28 112  315  624   670   312    30     0
  10 36 168  588 1554  2580  2340   810    56    0
  11 45 240 1008 3360  7735 11160  8160  2184   99   0
  12 55 330 1620 6552 19544 39990 48750 29120 5880 186 0
		

References

  • F. Bergeron, G. Labelle and P. Leroux, Combinatorial Species and Tree-Like Structures, Cambridge, 1998, p. 97 (2.3.74)
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, p. 495.
  • D. E. Knuth, Generating All Tuples and Permutations. The Art of Computer Programming, Vol. 4, Fascicle 2, pp. 26-27, Addison-Wesley, 2005.

Crossrefs

Columns k: A001037 (k=2), A027376 (k=3), A027377 (k=4), A001692 (k=5), A032164 (k=6), A001693 (k=7), A027380 (k=8), A027381 (k=9), A032165 (k=10), A032166 (k=11), A032167 (k=12), A060216 (k=13), A060217 (k=14), A060218 (k=15), A060219 (k=16), A060220 (k=17), A060221 (k=18), A060222 (k=19).
Rows n: A000027 (n=1), A000217(k-1) (n=2), A007290(k+1) (n=3), A006011 (n=4), A208536(k+1) (n=5), A292350 (n=6), A208537(k+1) (n=7).
Cf. A000010, A008683, A075147 (main diagonal), A102659, A215474 (preprime strings), A383011.

Programs

  • Magma
    t:= func< n,k | (&+[MoebiusMu(Floor(n/d))*k^d: d in Divisors(n)])/n >; // array
    A074650:= func< n,k | t(k, n-k+1) >; // downward diagonals
    [A074650(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Aug 01 2024
  • Maple
    with(numtheory):
    T:= proc(n, k) add(mobius(n/d)*k^d, d=divisors(n))/n end:
    seq(seq(T(i, 1+d-i), i=1..d), d=1..11);  # Alois P. Heinz, Mar 28 2008
  • Mathematica
    max = 12; t[n_, k_] := Total[ MoebiusMu[n/#]*k^# & /@ Divisors[n]]/n; Flatten[ Table[ t[n-k+1, k], {n, 1, max}, {k, n, 1, -1}]] (* Jean-François Alcover, Oct 18 2011, after Maple *)
  • PARI
    T(n,k)=sumdiv(n,d,moebius(n/d)*k^d)/n \\ Charles R Greathouse IV, Oct 18 2011
    
  • Sage
    # This algorithm generates and counts all k-ary n-tuples (a_1,..,a_n) such
    # that the string a_1...a_n is prime. It is algorithm F in Knuth 7.2.1.1.
    def A074650(n, k):
        a = [0]*(n+1); a[0]=-1
        j = 1; count = 0
        while(j != 0) :
            if j == n : count += 1; # print("".join(map(str,a[1:])))
            else: j = n
            while a[j] >= k-1 : j -= 1
            a[j] += 1
            for i in (j+1..n): a[i] = a[i-j]
        return count   # Peter Luschny, Aug 14 2012
    

Formula

T(n,k) = (1/n) * Sum_{d|n} mu(n/d)*k^d.
T(n,k) = (k^n - Sum_{dAlois P. Heinz, Mar 28 2008
From Richard L. Ollerton, May 10 2021: (Start)
T(n,k) = (1/n)*Sum_{i=1..n} mu(gcd(n,i))*k^(n/gcd(n,i))/phi(n/gcd(n,i)).
T(n,k) = (1/n)*Sum_{i=1..n} mu(n/gcd(n,i))*k^gcd(n,i)/phi(n/gcd(n,i)). (End)
From Seiichi Manyama, Apr 12 2025: (Start)
G.f. of column k: -Sum_{j>=1} mu(j) * log(1 - k*x^j) / j.
Product_{n>=1} 1/(1 - x^n)^T(n,k) = 1/(1 - k*x). (End)

A034827 a(n) = 2*binomial(n,4).

Original entry on oeis.org

0, 0, 0, 0, 2, 10, 30, 70, 140, 252, 420, 660, 990, 1430, 2002, 2730, 3640, 4760, 6120, 7752, 9690, 11970, 14630, 17710, 21252, 25300, 29900, 35100, 40950, 47502, 54810, 62930, 71920, 81840, 92752, 104720, 117810, 132090, 147630, 164502, 182780
Offset: 0

Views

Author

Keywords

Comments

Also number of ways to insert two pairs of parentheses into a string of n-4 letters (allowing empty pairs of parentheses). E.g., there are 30 ways for 2 letters. Cf. A002415.
2,10,30,70, ... gives orchard crossing number of complete graph K_n. - Ralf Stephan, Mar 28 2003
If Y is a 2-subset of an n-set X then, for n>=4, a(n-1) is the number of 4-subsets and 5-subsets of X having exactly one element in common with Y. - Milan Janjic, Dec 28 2007
Middle column of table on p. 6 of Feder and Garber. - Jonathan Vos Post, Apr 23 2009
Number of pairs of non-intersecting lines when each of n points around a circle is joined to every other point by straight lines. A pair of lines is considered non-intersecting if the lines do not intersect in either the interior or the boundary of a circle. - Melvin Peralta, Feb 05 2016
From a(2), convolution of the oblong numbers (A002378) with the nonnegative numbers (A001477). - Bruno Berselli, Oct 24 2016
Also the number of 3-cycles in the n-triangular honeycomb bishop graph. - Eric W. Weisstein, Aug 10 2017

References

  • Charles Jordan, Calculus of Finite Differences, Chelsea, 1965, p. 449.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

A diagonal of A088617.
Partial sums of A007290.
Cf. A051843 (4-cycles in the triangular honeycomb bishop graph), A290775 (5-cycles), A290779 (6-cycles).

Programs

Formula

a(n) = A096338(2*n-6) = 2*A000332(n), n>2. - R. J. Mathar, Nov 08 2010
G.f.: 2*x^4/(1-x)^5. - Colin Barker, Feb 29 2012
a(n) = Sum_{k=1..n-3} ( Sum_{i=1..k} i*(2*k-n+4) ). - Wesley Ivan Hurt, Sep 26 2013
E.g.f.: x^4*exp(x)/12. - G. C. Greubel, Feb 23 2017
From Amiram Eldar, Jul 19 2022: (Start)
Sum_{n>=4} 1/a(n) = 2/3.
Sum_{n>=4} (-1)^n/a(n) = 16*log(2) - 32/3. (End)

A008291 Triangle of rencontres numbers.

Original entry on oeis.org

1, 2, 3, 9, 8, 6, 44, 45, 20, 10, 265, 264, 135, 40, 15, 1854, 1855, 924, 315, 70, 21, 14833, 14832, 7420, 2464, 630, 112, 28, 133496, 133497, 66744, 22260, 5544, 1134, 168, 36, 1334961, 1334960, 667485, 222480, 55650, 11088, 1890, 240, 45, 14684570
Offset: 2

Views

Author

Keywords

Comments

T(n,k) = number of permutations of n elements with k fixed points.
T(n,n-1)=0 and T(n,n)=1 are omitted from the array. - Geoffrey Critzer, Nov 28 2011.

Examples

			Triangle begins:
       1
       2      3
       9      8     6
      44     45    20    10
     265    264   135    40   15
    1854   1855   924   315   70   21
   14833  14832  7420  2464  630  112  28
  133496 133497 66744 22260 5544 1134 168 36
  ...
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 194.
  • Kaufmann, Arnold. "Introduction a la combinatorique en vue des applications." Dunod, Paris, 1968. See p. 92.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 65.

Crossrefs

Row sums give A033312.
Cf. A320582.

Programs

  • Maple
    T:= proc(n, k) T(n, k):= `if`(k=0, `if`(n<2, 1-n, (n-1)*
          (T(n-1, 0)+T(n-2, 0))), binomial(n, k)*T(n-k, 0))
        end:
    seq(seq(T(n, k), k=0..n-2), n=2..12);  # Alois P. Heinz, Mar 17 2013
  • Mathematica
    Prepend[Flatten[f[list_]:=Select[list,#>1&];Map[f,Drop[Transpose[Table[d = Exp[-x]/(1 - x);Range[0, 10]! CoefficientList[Series[d x^k/k!, {x, 0, 10}],x], {k, 0, 8}]], 3]]], 1] (* Geoffrey Critzer, Nov 28 2011 *)
  • PARI
    T(n, k)= if(k<0 || k>n, 0, n!/k!*sum(i=0, n-k, (-1)^i/i!))

Formula

T(n,k) = binomial(n,k)*A000166(n-k) = A008290(n,k).
E.g.f. for column k: (x^k/k!)(exp(-x)/(1-x)). - Geoffrey Critzer, Nov 28 2011
Row generating polynomials appear to be given by -1 + sum {k = 0..n} (-1)^(n+k)*C(n,k)*(1+k*x)^(n-k)*(2+(k-1)*x)^k. - Peter Bala, Dec 29 2011

Extensions

Comments and more terms from Michael Somos, Apr 26 2000

A011886 a(n) = floor(n*(n-1)*(n-2)/4).

Original entry on oeis.org

0, 0, 0, 1, 6, 15, 30, 52, 84, 126, 180, 247, 330, 429, 546, 682, 840, 1020, 1224, 1453, 1710, 1995, 2310, 2656, 3036, 3450, 3900, 4387, 4914, 5481, 6090, 6742, 7440, 8184, 8976, 9817, 10710, 11655, 12654, 13708, 14820, 15990, 17220, 18511, 19866, 21285
Offset: 0

Views

Author

Keywords

Crossrefs

Sequences of the form floor(n*(n-1)*(n-2)/m): A007531 (m=1), A135503 (m=2), A007290 (m=3), this sequence (m=4), A011887 (m=5), A000292 (m=6), A011889 (m=7), A011890 (m=8), A011891 (m=9), A011892 (m=10), A011893 (m=11), A011894 (m=12), A011895 (m=13), A011896 (m=14), A011897 (m=15), A011898 (m=16), A011899 (m=17), A011849 (m=18), A011901 (m=19), A011902 (m=20), A011903 (m=21), A011904 (m=22), A011905 (m=23), A011842 (m=24), A011907 (m=25), A011908 (m=26), A011909 (m=27), A011910 (m=28), A011911 (m=29), A011912 (m=30), A011912 (m=31), A011913 (m=32).

Programs

  • Magma
    [Floor(n*(n-1)*(n-2)/4): n in [0..50]]; // Vincenzo Librandi, Jul 07 2012
    
  • Mathematica
    Table[Floor[(n(n-1)(n-2))/4],{n,0,50}] (* or *) LinearRecurrence[{3,-3,1,1, -3,3,-1},{0,0,0,1,6,15,30}, 50] (* Harvey P. Dale, Feb 25 2012 *)
    CoefficientList[Series[x^3*(1+3*x+2*x^3)/((1-x)^3*(1-x^4)),{x,0,50}],x] (* Vincenzo Librandi, Jul 07 2012 *)
  • SageMath
    [3*binomial(n,3)//2 for n in range(51)] # G. C. Greubel, Oct 06 2024

Formula

From R. J. Mathar, Apr 15 2010: (Start)
a(n) = +3*a(n-1) -3*a(n-2) +a(n-3) +a(n-4) -3*a(n-5) +3*a(n-6) -a(n-7).
G.f.: x^3*(1+3*x+2*x^3) / ( (1-x)^4*(1+x)*(1+x^2) ). (End)
a(n) = floor(Sum_{k=0..n} n*(k+1)/2) for n >= -2. - William A. Tedeschi, Sep 10 2010

Extensions

More terms from William A. Tedeschi, Sep 10 2010

A084990 a(n) = n*(n^2+3*n-1)/3.

Original entry on oeis.org

0, 1, 6, 17, 36, 65, 106, 161, 232, 321, 430, 561, 716, 897, 1106, 1345, 1616, 1921, 2262, 2641, 3060, 3521, 4026, 4577, 5176, 5825, 6526, 7281, 8092, 8961, 9890, 10881, 11936, 13057, 14246, 15505, 16836, 18241, 19722, 21281, 22920, 24641, 26446, 28337, 30316
Offset: 0

Views

Author

Gary W. Adamson, Jul 16 2003

Keywords

Comments

Row sums of triangle A131782 starting (1, 6, 17, 36, 65, 106, ...). - Gary W. Adamson, Jul 14 2007
a(n) is the number of triples (x,y,z) in {1,2,...,n}^3 with x <= y <= z or x >= y >= z. - Jack Kennedy, Mar 14 2009
a(2*n) is the difference between numbers of nonnegative multiples of 2*n+1 with even and odd digit sum in base 2*n in interval [0, 16*n^4). - Vladimir Shevelev, May 18 2012

Examples

			Let n=2. Consider nonnegative multiples of 5 up to 16*2^4 - 1 = 255. There are 52 such numbers and from them only 8 (namely, 35, 50, 55, 115, 140, 200, 205, 220) have an odd digit sum in base 4. Therefore, a(4) = (52 - 8) - 8 = 36. - _Vladimir Shevelev_, May 18 2012
		

Crossrefs

Programs

Formula

a(n) = 2*A000292(n-1) - 1 (notice offset=-1 in A000292!).
a(n) = (n-1)*(n+1)*(n+3)/3 + 1. - Reinhard Zumkeller, Aug 20 2007
a(n) = A077415(n+1) + 1 for n > 0; a(n) = A000290(n) + A007290(n); a(n+1) = Sum_{k=0..n} A028387(k). - Reinhard Zumkeller, Aug 20 2007
a(2*n) = Sum_{i=0..16*n^4, i==0 (mod 2*n+1)} (-1)^s_(2*n)(i), where s_k(n) is the digit sum of n in base k. - Vladimir Shevelev, May 18 2012
a(2*n) = (2/(2*n+1))*Sum_{i=1..n} tan^4(Pi*i/(2*n+1)). - Vladimir Shevelev, May 23 2012
a(n) = Sum_{i=1..n} i*(i+1)-1. - Wesley Ivan Hurt, Oct 19 2013
G.f.: x*(1+2*x-x^2)/(1-x)^4. - Vincenzo Librandi, Mar 28 2014
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n > 3. - Vincenzo Librandi, Mar 28 2014
a(n) = A064043(n)/3. - Alois P. Heinz, Jul 21 2017
E.g.f.: x*exp(x)*(x^2 + 6*x + 3)/3. - Stefano Spezia, Mar 06 2024

A071951 Triangle of Legendre-Stirling numbers of the second kind T(n,j), n >= 1, 1 <= j <= n, read by rows.

Original entry on oeis.org

1, 2, 1, 4, 8, 1, 8, 52, 20, 1, 16, 320, 292, 40, 1, 32, 1936, 3824, 1092, 70, 1, 64, 11648, 47824, 25664, 3192, 112, 1, 128, 69952, 585536, 561104, 121424, 7896, 168, 1, 256, 419840, 7096384, 11807616, 4203824, 453056, 17304, 240, 1, 512, 2519296, 85576448, 243248704, 137922336, 23232176, 1422080, 34584, 330, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jun 16 2002

Keywords

Comments

Removing a factor of 2^m from the m-th subdiagonal (the main diagonal corresponds to m = 0) gives the triangle A080248. - Peter Bala, Oct 15 2023

Examples

			The triangle begins:
n\j   1      2       3        4       5      6     7   8 9 ...
1:    1
2:    2      1
3:    4      8       1
4:    8     52      20        1
5:   16    320     292       40       1
6:   32   1936    3824     1092      70      1
7:   64  11648   47824    25664    3192    112     1
8:  128  69952  585536   561104  121424   7896   168   1
9:  256 419840 7096384 11807616 4203824 453056 17304 240 1
...
Row 10: 512 2519296 85576448 243248704 137922336 23232176 1422080 34584 330 1. Reformatted by _Wolfdieter Lang_, Apr 10 2013
		

Crossrefs

Diagonals give A007290, A000079, A016129, A016309.
The column sequences are A000079 (powers of 2), A016129, A016309, A071952, A089274, A089277.

Programs

  • Magma
    [[(&+[(-1)^(r+j)*(2*r+1)*(r^2+r)^n/(Factorial(r+j+1)*Factorial(j-r)): r in [1..j]]): j in [1..n]]: n in [1..12]]; // G. C. Greubel, Mar 16 2019
    
  • Maple
    N:= 20: # to get the first N rows, flattened
    for j from 1 to N do S[j]:= series(x^j/mul(1-r*(r+1)*x, r=1..j), x, N+1) od:
    seq(seq(coeff(S[j],x,i),j=1..i),i=1..N); # Robert Israel, Dec 03 2015
    # alternative
    A071951 := proc(n,k)
        option remember;
        if k =0 then
            if n = 0 then
                1;
            else
                0;
            end if;
        elif n = 0 then
            if k =0 then
                1;
            else
                0;
            end if;
        else
            procname(n-1,k-1)+k*(k+1)*procname(n-1,k) ;
        end if;
    end proc: # R. J. Mathar, Jun 30 2018
  • Mathematica
    Flatten[ Table[ Sum[(-1)^{r + j}(2r + 1)(r^2 + r)^n/((r + j + 1)!(j - r)!), {r, j}], {n, 10}, {j, n}]]
  • PARI
    {T(n, k) = sum( i=0, k, (-1)^(i+k) * (2*i + 1) * (i*i + i)^n / (k-i)! / (k+i+1)! )} /* Michael Somos, Feb 25 2012 */
    
  • Sage
    [[sum( (-1)^(r+j)*(2*r+1)*(r^2+r)^n/(factorial(r+j+1)*factorial(j-r)) for r in (1..j)) for j in (1..n)] for n in (1..12)] # G. C. Greubel, Mar 16 2019

Formula

T(n, j) = Sum_{r=1..j} (-1)^(r+j)*(2*r+1)*(r^2+r)^n/((r+j+1)!*(j-r)!).
G.f. for j-th column (without leading zeros): 1/Product_{r=1..j} (1 - r*(r+1)*x), j >= 1. From eq.(4.5) of the Everitt et al. paper.
A135921(n+1) = row sums. - Michael Somos, Feb 25 2012
Sum_{n=j..m} binomial(m,n)*T(n,j)*4^(n-j) = A160562(m,j) for 1 <= j <= m. - Werner Schulte, Dec 03 2015

A059419 Triangle T(n,k) (1 <= k <= n) of tangent numbers, read by rows: T(n,k) = coefficient of x^n/n! in expansion of (tan x)^k/k!.

Original entry on oeis.org

1, 0, 1, 2, 0, 1, 0, 8, 0, 1, 16, 0, 20, 0, 1, 0, 136, 0, 40, 0, 1, 272, 0, 616, 0, 70, 0, 1, 0, 3968, 0, 2016, 0, 112, 0, 1, 7936, 0, 28160, 0, 5376, 0, 168, 0, 1, 0, 176896, 0, 135680, 0, 12432, 0, 240, 0, 1, 353792, 0, 1805056, 0, 508640, 0, 25872, 0, 330, 0, 1, 0
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2001

Keywords

Comments

(tan(x))^k = sum{n>0, If n+k is odd, T(n,k) = 0 = n!/k!*(-1)^((n+k)/2)*sum{j=k..n} (j!/n!) * Stirling2(n,j) * 2^(n-j) * (-1)^(n+j-k) * binomial(j-1,k-1)*x^n}. - Vladimir Kruchinin, Aug 13 2012
Also the Bell transform of A009006(n+1). For the definition of the Bell transform see A264428. - Peter Luschny, Jan 26 2016

Examples

			     1;
     0,     1;
     2,     0,     1;
     0,     8,     0,    1;
    16,     0,    20,    0,    1;
     0,   136,     0,   40,    0,   1;
   272,     0,   616,    0,   70,   0,   1;
     0,  3968,     0, 2016,    0, 112,   0,  1;
  7936,     0, 28160,    0, 5376,   0, 168,  0,  1;
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 259.

Crossrefs

Diagonals give A000182, A024283, A059420 (interspersed with 0's), also A007290, A059421. Row sums give A006229. Essentially the same triangle as A008308.
A111593 (signed triangle with extra column k=0 and row n=0).

Programs

  • Maple
    A059419 := proc(n,k) option remember; if n = k then 1; elif k <0 or k > n then 0; else  procname(n-1,k-1)+k*(k+1)*procname(n-1,k+1) ; end if; end proc: # R. J. Mathar, Feb 11 2011
    # The function BellMatrix is defined in A264428.
    # Adds (1, 0, 0, 0, ..) as column 0.
    BellMatrix(n -> 2^(n+1)*abs(euler(n+1, 1)), 10); # Peter Luschny, Jan 26 2016
  • Mathematica
    d[f_ ] := (1+x^2)*D[f, x]; d[ f_, n_] := Nest[d, f, n]; row[n_] := Rest[ CoefficientList[ d[Exp[x*t], n] /. x -> 0, t]]; Flatten[ Table[ row[n], {n, 1, 12}]] (* Jean-François Alcover, Dec 21 2011, after Peter Bala *)
    rows = 12;
    t = Table[2^(n+1)*Abs[EulerE[n+1, 1]], {n, 0, rows}];
    T[n_, k_] := BellY[n, k, t];
    Table[T[n, k], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 22 2018, after Peter Luschny *)
  • PARI
    T(n,k)=if(k<1 || k>n,0,n!*polcoeff(tan(x+x*O(x^n))^k/k!,n))
    
  • Sage
    def A059419_triangle(dim):
        M = matrix(ZZ, dim, dim)
        for n in (0..dim-1): M[n,n] = 1
        for n in (1..dim-1):
            for k in (0..n-1):
                M[n,k] = M[n-1,k-1]+(k+1)*(k+2)*M[n-1,k+1]
        return M
    A059419_triangle(9) # Peter Luschny, Sep 19 2012

Formula

T(n+1, k) = T(n, k-1) + k*(k+1)*T(n, k+1), T(n, n) = 1.
If n+k is odd, T(n,k) = 0 = 1/k!*(-1)^((n+k)/2)*Sum_{j=k..n} j!* Stirling2(n,j)*2^(n-j)*(-1)^(n+j-k)*binomial(j-1,k-1). - Vladimir Kruchinin, Feb 10 2011
E.g.f.: exp(t*tan(x))-1 = t*x + t^2*x^2/2! + (2*t + t^3)*x^3/3! + ....
The row polynomials are given by D^n(exp(x*t)) evaluated at x = 0, where D is the operator (1+x^2)*d/dx. - Peter Bala, Nov 25 2011
The o.g.f.s of the diagonals of this triangle are rational functions obtained from the series reversion (x-t*tan(x))^(-1) = x/(1-t) + 2*t/(1-t)^4*x^3/3! + 8*t*(2+3*t)/(1-t)^7*x^5/5! + 16*t*(17+78*t+45*t^2)/(1-t)^10*x^7/7! + .... For example, the fourth subdiagonal has o.g.f. 8*t*(2+3*t)/(1-t)^7 = 16*t + 136*t^2 + 616*t^3 + .... - Peter Bala, Apr 23 2012
With offset 0 and initial column of zeros, except for T(0,0) = 1, e.g.f.(t,x) = e^(x*tan(t)) = e^(P(.,x)t) ; the lowering operator, L = atan(d/dx) ; and the raising operator, R = x [1 +(d/dx)^2], where L P(n,x) = n P(n-1,x) and R P(n,x) = P(n+1,x). The sequence is a binomial Sheffer sequence. - Tom Copeland, Oct 01 2015

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 01 2001

A208535 Square array read by descending antidiagonals: T(n,k) is the number of n-bead necklaces of k colors not allowing reversal, with no adjacent beads having the same color (n, k >= 1).

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 4, 3, 0, 0, 5, 6, 2, 1, 0, 6, 10, 8, 6, 0, 0, 7, 15, 20, 24, 6, 1, 0, 8, 21, 40, 70, 48, 14, 0, 0, 9, 28, 70, 165, 204, 130, 18, 1, 0, 10, 36, 112, 336, 624, 700, 312, 36, 0, 0, 11, 45, 168, 616, 1554, 2635, 2340, 834, 58, 1, 0, 12, 55, 240, 1044, 3360, 7826, 11160
Offset: 1

Views

Author

R. H. Hardin, Feb 27 2012

Keywords

Comments

For prime rows, these appear to be evaluations of Moreau's necklace polynomials at the integers with several combinatorial interpretations (see Wikipedia link). - Tom Copeland, Oct 20 2014
From Petros Hadjicostas, Nov 05 2017: (Start)
The g.f. for column k follows easily from I. Gessel's formulas for this sequence. Since S(1,k) = k-1, we have T(1,k) = k + S(1,k) - (k - 1). Thus, Sum_{n >= 1} T(n,k)*x^n = k*x + Sum_{n >= 1} (1/n)*Sum_{d|n} (k - 1)^d*phi(n/d)*x^n - Sum_{s=0} (k-1)*x^{2*s+1}. Letting m = n/d, we get that (column k g.f.) = k*x - (k - 1)*x/(1 -x^2) + Sum_{m >= 1} (phi(m)/m)*Sum_{d >= 1}((k - 1)*x^m)^d/d. But Sum_{d>=1} z^d/d = -log(1 - z), and so (column k g.f.) = k*x - (k - 1)*x/(1 - x^2) - Sum_{m >= 1} (phi(m)/m)*log(1 - (k - 1)*x^m).
The other formula for the g.f. of column k of this sequence follows from the formula Sum_{n >= 1} (phi(n)/n)*log(1 + t^n) = t/(1 - t^2), which in turn follows from the well-known series Sum_{n >= 1} phi(n)*t^n/(1 + t^n) = t*(1 + t^2)/(1 - t^2)^2.
The extra term k*x in the g.f. for column k is due to the fact that we conventionally assume that a necklace with only one bead, colored with one of the k colors available, is such that there are "no adjacent beads having the same color" (even though, strictly speaking, a single bead is adjacent to itself when we go around the circle of the necklace).
One can use the g.f. for column k to derive the so-called "Empirical for row n" formulae that are denoted by a(k) and given in the formula section below (from n = 1 to n = 7). For example, for n = 3, a(k) = a(k, x=0), where a(k, x) = (1/3!)*d^3/dx^3 (column k g.f.). Here, d^3/dx^3 stands for "third derivative w.r.t. x". If we let f(x) = x/(1 - x^2) and g(x, m) = -log(1 - (k - 1)*x^m), then f^{(3)}(0) = 6, while g^{(3)}(0,m) = 2*(k - 1)^3 for m = 1, 0 for m=2, 6*(k - 1) for m = 3, and 0 for m >= 4. Then, a(k) = (1/6)*(-6*(k - 1) + 2*(k - 1)^3 + (2/3)*6*(k - 1)) = (1/3)*k^3 - k^2 + (2/3)*k. Using this method, one can derive an "Empirical for row n" formula for a(k) for any positive integer n. (End)

Examples

			Table T(n,k) (with rows n >= 1 and columns k >= 1) starts:
  1 2  3   4    5     6      7      8       9      10       11       12       13 ...
  0 1  3   6   10    15     21     28      36      45       55       66       78 ...
  0 0  2   8   20    40     70    112     168     240      330      440      572 ...
  0 1  6  24   70   165    336    616    1044    1665     2530     3696     5226 ...
  0 0  6  48  204   624   1554   3360    6552   11808    19998    32208    49764 ...
  0 1 14 130  700  2635   7826  19684   43800   88725   166870   295526   498004 ...
  0 0 18 312 2340 11160  39990 117648  299592  683280  1428570  2783880  5118828 ...
  0 1 36 834 8230 48915 210126 720916 2097684 5381685 12501280 26796726 53750346 ...
  ...
All solutions for n = 4 and k = 3:
  1    2    1    1    1    1
  3    3    2    2    3    2
  2    2    3    1    1    1
  3    3    2    2    3    3
		

Crossrefs

Columns 3..6: A106365, A106366, A106367, A106368.
Rows 2..7: A000217(n-1), A007290, A006528(n-1), A208536, A006565(n-1), A208537.

Programs

  • Mathematica
    T[n_, k_] := If[n == 1, k, Sum[ EulerPhi[n/d]*(k-1)^d, {d, Divisors[n]}]/n - If[OddQ[n], k-1, 0]]; Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 31 2017, after Andrew Howroyd *)
  • PARI
    T(n,k) = if(n==1, k, sumdiv(n,d,eulerphi(n/d)*(k-1)^d)/n - if(n%2, k-1));
    for(n=1, 10, for(k=1, 10, print1(T(n,k), ", ")); print) \\ Andrew Howroyd, Oct 14 2017

Formula

Let S(n,k) = (1/n) Sum_{d|n} (k-1)^d phi(n/d), where phi is Euler's function.
Then for n even, T(n,k) = S(n,k) and for n > 1 and odd, T(n,k) = S(n,k) - (k-1), and T(1,k) = k. - Ira M. Gessel, Oct 21 2014, Sep 25 2017
Empirical for row n:
n=1: a(k) = k
n=2: a(k) = (1/2)*k^2 - (1/2)*k
n=3: a(k) = (1/3)*k^3 - k^2 + (2/3)*k
n=4: a(k) = (1/4)*k^4 - k^3 + (7/4)*k^2 - k
n=5: a(k) = (1/5)*k^5 - k^4 + 2*k^3 - 2*k^2 + (4/5)*k
n=6: a(k) = (1/6)*k^6 - k^5 + (5/2)*k^4 - (19/6)*k^3 + (7/3)*k^2 - (5/6)*k
n=7: a(k) = (1/7)*k^7 - k^6 + 3*k^5 - 5*k^4 + 5*k^3 - 3*k^2 + (6/7)*k
-----------
From Tom Copeland, Oct 20 2014: (Start)
The first three numbers in each row of the triangular array are given by T(n,k) = (1/k)*(n-k+1)! / (n-2*k+1)!.
For the table here, the first three rows, aside from initial zeros, are given by a(n,k) = (1/n)*(k + 1 - n)! / (k + 1 - 2*n)! or, with no leading zeros, by a(n,k) = (1/n)*(n+k-1)! / (k-1)!. The first three elements of each column correspond to the last three elements of a row in A238363 and the first three of A111492.
Prime rows (> 1) appear to be a(m,n) = (n^m - n)/m. See Wikipedia link. (End)
G.f. for column k: Sum_{n >= 1} T(n,k)*x^n = k*x - Sum_{n >= 1} (phi(n)/n)*((k - 1)*log(1 + x^n) + log(1 - (k - 1)*x^n)) = k*x - (k - 1)*x/(1 - x^2) - Sum_{n >= 1} (phi(n)/n)*log(1 - (k - 1)*x^n). - Petros Hadjicostas, Nov 05 2017

Extensions

Name edited by Petros Hadjicostas, Jun 24 2020

A271034 T(n,k)=Number of nXnXn triangular 0..k arrays with some element less than a w, nw or ne neighbor exactly once.

Original entry on oeis.org

0, 0, 2, 0, 8, 10, 0, 20, 72, 34, 0, 40, 294, 450, 98, 0, 70, 896, 3114, 2420, 258, 0, 112, 2268, 15116, 29120, 12010, 642, 0, 168, 5040, 58036, 232432, 256020, 56754, 1538, 0, 240, 10164, 188034, 1402082, 3441072, 2173554, 259628, 3586, 0, 330, 19008, 535106
Offset: 1

Views

Author

R. H. Hardin, Mar 29 2016

Keywords

Comments

Table starts
....0.......0.........0...........0............0..............0...............0
....2.......8........20..........40...........70............112.............168
...10......72.......294.........896.........2268...........5040...........10164
...34.....450......3114.......15116........58036.........188034..........535106
...98....2420.....29120......232432......1402082........6872424........28658242
..258...12010....256020.....3441072.....33505396......255757328......1610555756
..642...56754...2173554....50108414....804566180.....9790184488.....95420380090
.1538..259628..18060096...724727082..19525545192...386105784866...5945425725202
.3586.1160936.147976270.10461499634.479803630966.15669594394610.387907415514308

Examples

			Some solutions for n=4 k=4
.....0........0........0........1........0........1........0........0
....0.0......0.3......1.0......2.3......0.0......1.1......0.2......0.0
...1.0.0....3.3.3....3.4.4....3.4.4....0.1.3....0.1.2....0.2.2....1.1.0
..1.1.1.1..4.4.3.4..4.4.4.4..3.3.4.4..2.4.3.3..2.3.4.4..0.0.2.3..4.4.4.4
		

Crossrefs

Column 1 is A036799(n-1).
Row 2 is A007290(n+2).

Formula

Empirical for column k:
k=1: a(n) = 5*a(n-1) -8*a(n-2) +4*a(n-3)
Empirical for row n:
n=2: a(n) = (1/3)*n^3 + n^2 + (2/3)*n
n=3: [polynomial of degree 6]
n=4: [polynomial of degree 10]
n=5: [polynomial of degree 15]
n=6: [polynomial of degree 21]

A212124 Total number of states of the first n subshells of the nuclear shell model in which the subshells are ordered by energy level in increasing order.

Original entry on oeis.org

2, 6, 8, 14, 16, 20, 28, 32, 38, 40, 50, 58, 64, 68, 70, 82, 92, 100, 106, 110, 112, 126, 136, 142, 154, 162, 164, 168, 184
Offset: 1

Views

Author

Omar E. Pol, Jun 03 2012

Keywords

Comments

First differs from A213364 at a(12).

Examples

			Example 1: written as a triangle in which apparently row i is related to the (i-1)st level of nucleus. Triangle begins:
2;
6,     8;
14,   16,  20;
28,   32,  38,  40;
50,   58,  64,  68,  70;
82,   92, 100, 106, 110, 112;
126, 136, 142, 154, 162, 164, 168;
...
Example 2: written as an irregular triangle in which row j is related to the j-th shell of nucleus. In this case note that row 4 has only one term. Triangle begins:
2;
6,     8;
14,   16,  20;
28,
32,   38,  40,  50;
58,   64,  68,  70,  82;
92,  100, 106, 110, 112, 126;
136, 142, 154, 162, 164, 168, 184;
...
First seven terms of right border give the "magic numbers" A018226.
		

References

  • M. Goeppert Mayer and J. Hans D. Jensen, Elementary Theory of Nuclear Shell Structure, J. Wiley and Sons, Inc. (1955).

Crossrefs

Partial sums of A212122. Other versions are A210984, A212014, A213364, A213374.

Formula

a(n) = 2*A212123(n).
Previous Showing 11-20 of 73 results. Next