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 41-50 of 80 results. Next

A269656 T(n,k) = number of length-n 0..k arrays with no adjacent pair x,x+1 repeated: infinite square array read by falling antidiagonals.

Original entry on oeis.org

2, 3, 4, 4, 9, 8, 5, 16, 27, 15, 6, 25, 64, 79, 26, 7, 36, 125, 253, 225, 42, 8, 49, 216, 621, 988, 626, 64, 9, 64, 343, 1291, 3065, 3816, 1710, 93, 10, 81, 512, 2395, 7686, 15036, 14596, 4605, 130, 11, 100, 729, 4089, 16681, 45590, 73348, 55344, 12259, 176, 12, 121
Offset: 1

Views

Author

R. H. Hardin, Mar 02 2016

Keywords

Comments

The table could be extended to T(0,k) = T(n,0) = 1, since there is exactly one length-0 array {()} and exactly one length-n array with coefficients in 0..0, {(0,...,0)}, each of which satisfies the requirement. The "empirical" formulas for n = 1, ..., 5 are easily proved, cf., e.g., A269657. - M. F. Hasler, Feb 29 2020

Examples

			Table starts
    2     3      4       5        6         7          8          9         10
    4     9     16      25       36        49         64         81        100
    8    27     64     125      216       343        512        729       1000
   15    79    253     621     1291      2395       4089       6553       9991
   26   225    988    3065     7686     16681      32600      58833      99730
   42   626   3816   15036    45590    115902     259476     527576     994626
   64  1710  14596   73348   269472    803434    2061940    4725456    9911008
   93  4605  55344  355921  1587450   5556909   16359580   42277329   98674806
  130 12259 208196 1718569  9321628  38350583  129599404  377821501  981592964
  176 32320 777582 8259567 54569340 264117327 1025145474 3372803487 9756620832
Some solutions for n=6, k=4:
  1  2  2  3  1  0  3  3  3  3  1  2  3  4  3  3
  3  2  4  3  3  1  4  3  4  0  4  2  2  3  0  3
  2  3  1  3  2  2  4  2  0  1  0  3  2  3  0  2
  0  2  4  4  1  4  2  3  0  4  0  3  2  3  0  3
  4  2  0  1  4  4  2  1  1  2  4  0  0  3  2  1
  0  1  1  0  0  4  4  2  4  3  3  3  1  0  3  0
		

Crossrefs

Column 1 is A000125.
Row 1 is A000027(n+1).
Row 2 is A000290(n+1).
Row 3 is A000578(n+1).
Rows 4, ..., 7: A269657, A269658, A269659 and A269660 (see there for formulas).

Formula

Empirical for column k, apparently a recurrence of order (k+1)^2:
k=1: a(n) = (1/6)*n^3 + (5/6)*n + 1
k=2: [linear recurrence of order 9]
k=3: [order 16]
k=4: [order 25]
k=5: [order 36]
k=6: [order 49]
k=7: [order 64]
Empirical for row n:
n=1: a(n) = n + 1 = #{ v = (m); 0 <= m <= n }.
n=2: a(n) = n^2 + 2*n + 1 = (n+1)^2 = #{ v in {0..n}^2 }.
n=3: a(n) = n^3 + 3*n^2 + 3*n + 1 = (n+1)^3 = #{ v in {0..n}^3 }.
n=4: a(n) = n^4 + 4*n^3 + 6*n^2 + 3*n + 1 = (n+1)^4 - n, cf. A269657.
n=5: a(n) = n^5 + 5*n^4 + 10*n^3 + 7*n^2 + 2*n + 1 = (n+1)^5 - 3*n*(n+1).
n=6: a(n) = n^6 + 6*n^5 + 15*n^4 + 14*n^3 + 3*n^2 + 3*n.
n=7: a(n) = n^7 + 7*n^6 + 21*n^5 + 25*n^4 + 5*n^3 + 2*n^2 + 11*n - 8.

Extensions

Edited by M. F. Hasler, Feb 29 2020

A255992 T(n,k)=Number of length n+k 0..1 arrays with at most one downstep in every k consecutive neighbor pairs.

Original entry on oeis.org

4, 8, 8, 15, 16, 16, 26, 28, 32, 32, 42, 45, 53, 64, 64, 64, 68, 80, 100, 128, 128, 93, 98, 114, 144, 188, 256, 256, 130, 136, 156, 196, 256, 354, 512, 512, 176, 183, 207, 257, 337, 451, 667, 1024, 1024, 232, 240, 268, 328, 428, 568, 796, 1256, 2048, 2048, 299, 308
Offset: 1

Views

Author

R. H. Hardin, Mar 13 2015

Keywords

Comments

Table starts
....4....8...15...26...42...64...93..130..176..232..299..378..470..576...697
....8...16...28...45...68...98..136..183..240..308..388..481..588..710...848
...16...32...53...80..114..156..207..268..340..424..521..632..758..900..1059
...32...64..100..144..196..257..328..410..504..611..732..868.1020.1189..1376
...64..128..188..256..337..428..530..644..771..912.1068.1240.1429.1636..1862
..128..256..354..451..568..705..854.1016.1192.1383.1590.1814.2056.2317..2598
..256..512..667..796..945.1134.1352.1584.1831.2094.2374.2672.2989.3326..3684
..512.1024.1256.1413.1574.1797.2088.2419.2766.3130.3512.3913.4334.4776..5240
.1024.2048.2365.2510.2645.2848.3175.3606.4090.4592.5113.5654.6216.6800..7407
.2048.4096.4454.4448.4476.4560.4824.5294.5912.6598.7304.8031.8780.9552.10348

Examples

			Some solutions for n=4 k=4
..1....1....0....0....0....0....0....1....0....0....1....0....1....0....0....0
..1....0....0....1....1....0....0....1....1....0....1....0....1....0....0....1
..1....0....1....1....1....0....1....0....0....0....1....1....0....1....0....1
..1....1....0....1....0....1....1....0....0....0....0....1....0....0....1....1
..0....1....0....0....0....1....1....1....0....1....1....1....1....0....1....1
..1....1....0....1....1....0....1....1....0....0....1....1....1....0....1....1
..1....0....0....1....1....1....1....1....1....1....1....0....1....0....1....0
..1....1....1....1....0....1....0....1....0....1....0....1....0....0....1....1
		

Crossrefs

Column 1 is A000079(n+1)
Column 2 is A000079(n+2)
Column 3 is A118870(n+3)
Row 1 is A000125(n+1)

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1)
k=2: a(n) = 2*a(n-1)
k=3: a(n) = 2*a(n-1) -a(n-2) +2*a(n-3) -a(n-4)
k=4: a(n) = 2*a(n-1) -a(n-2) +3*a(n-4) -2*a(n-5)
k=5: a(n) = 2*a(n-1) -a(n-2) +4*a(n-5) -3*a(n-6)
k=6: a(n) = 2*a(n-1) -a(n-2) +5*a(n-6) -4*a(n-7)
k=7: a(n) = 2*a(n-1) -a(n-2) +6*a(n-7) -5*a(n-8)
Empirical for row n:
n=1: a(n) = (1/6)*n^3 + (1/2)*n^2 + (4/3)*n + 2
n=2: a(n) = (1/6)*n^3 + n^2 + (23/6)*n + 3
n=3: a(n) = (1/6)*n^3 + (3/2)*n^2 + (31/3)*n + 4
n=4: a(n) = (1/6)*n^3 + 2*n^2 + (143/6)*n + 6 for n>2
n=5: a(n) = (1/6)*n^3 + (5/2)*n^2 + (145/3)*n + 12 for n>3
n=6: a(n) = (1/6)*n^3 + 3*n^2 + (533/6)*n + 28 for n>4
n=7: a(n) = (1/6)*n^3 + (7/2)*n^2 + (454/3)*n + 64 for n>5

A046127 Maximal number of regions into which space can be divided by n spheres.

Original entry on oeis.org

0, 2, 4, 8, 16, 30, 52, 84, 128, 186, 260, 352, 464, 598, 756, 940, 1152, 1394, 1668, 1976, 2320, 2702, 3124, 3588, 4096, 4650, 5252, 5904, 6608, 7366, 8180, 9052, 9984, 10978, 12036, 13160, 14352, 15614, 16948, 18356, 19840, 21402, 23044
Offset: 0

Views

Author

Keywords

Comments

If Y is a 2-subset of an n-set X then, for n >= 2, a(n-2) is equal to the number of 2-subsets and 4-subsets of X having exactly one element in common with Y. - Milan Janjic, Dec 28 2007

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 73, Problem 4.
  • A. M. Yaglom and I. M. Yaglom: Challenging Mathematical Problems with Elementary Solutions. Vol. I. Combinatorial Analysis and Probability Theory. New York: Dover Publications, Inc., 1987, p. 13, #45 (First published: San Francisco: Holden-Day, Inc., 1964).

Crossrefs

Cf. A014206 (dim 2), this sequence (dim 3), A059173 (dim 4), A059174 (dim 5). See also A000124, A000125. A row of A059250.
Cf. A033547.

Programs

  • Mathematica
    Join[{0},Table[n (n^2-3n+8)/3,{n,50}]]  (* Harvey P. Dale, Apr 21 2011 *)
  • Python
    def a(n): return n*(n**2 - 3*n + 8)//3 # Philip C. Ritchey, Dec 10 2017

Formula

a(n) = f(n,3) where f(n,k) = C(n-1, k) + Sum_{i=0..k} C(n, i) for hyperspheres in R^k.
a(n) = n*(n^2 - 3*n + 8)/3.
From Philip C. Ritchey, Dec 09 2017: (Start)
The above identity proved as closed form of the following summation and its corresponding recurrence relation:
a(n) = Sum_{i=1..n} (i*(i-3) + 4).
a(n) = a(n-1) + n*(n-3) + 4, a(0) = 0. (End)
From Colin Barker, Jan 28 2012: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
G.f.: 2*x*(1 - 2*x + 2*x^2)/(1 - x)^4. (End)
a(n) = A033547(n-1) + 2 for n >= 1. - Jianing Song, Feb 03 2024
E.g.f.: exp(x)*x*(6 + x^2)/3. - Stefano Spezia, Feb 15 2024

A161856 Triangle read by rows in which row n lists the coefficients of the interpolating polynomial for its divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 0, 2, 1, 6, 1, 1, 1, 1, 1, 2, 4, 1, 1, 2, 0, 1, 10, 1, 1, 0, 0, 1, 1, 1, 12, 1, 1, 4, -2, 1, 2, 0, 8, 1, 1, 1, 1, 1, 1, 16, 1, 1, 0, 2, -4, 12, 1, 18, 1, 1, 1, -2, 7, -11, 1, 2, 2, 8, 1, 1, 8, -6, 1, 22, 1, 1, 0, 0, 1, -3, 8, -12, 1, 4, 16, 1, 1, 10, -8, 1, 2, 4, 8, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 20 2009

Keywords

Comments

EDP(n,x) = SUM(a(A006218(n)-1+i)*A007318(x,i-1): 1<=i<=A000005(n)) is the interpolating polynomial for the divisors of n, see also A161700;
A000005(n) = length of n-th row, i.e. same length as n-th row in A027750;
sum of n-th row, n>1: A161857(n) = SUM(a(A006218(n-1)+i): 1<=i<=A000005(n));
a(A006218(n)+1) = 1.

Examples

			1; 1,1; 1,2; 1,1,1; 1,4; 1,1,0,2; 1,6; 1,1,1,1; 1,2,4; ... .
		

Crossrefs

A252828 T(n,k)=Number of nXk nonnegative integer arrays with upper left 0 and every value within 3 of its city block distance from the upper left and every value increasing by 0 or 1 with every step right or down.

Original entry on oeis.org

1, 2, 2, 4, 6, 4, 8, 18, 18, 8, 15, 53, 81, 53, 15, 26, 142, 340, 340, 142, 26, 42, 339, 1238, 1920, 1238, 339, 42, 64, 729, 3891, 9075, 9075, 3891, 729, 64, 93, 1437, 10761, 36292, 54376, 36292, 10761, 1437, 93, 130, 2638, 26764, 125892, 271846, 271846, 125892
Offset: 1

Views

Author

R. H. Hardin, Dec 22 2014

Keywords

Comments

Table starts
...1....2......4.......8.......15........26.........42..........64...........93
...2....6.....18......53......142.......339........729........1437.........2638
...4...18.....81.....340.....1238......3891......10761.......26764........60988
...8...53....340....1920.....9075.....36292.....125892......387849......1082111
..15..142...1238....9075....54376....271846....1165921.....4396009.....14863460
..26..339...3891...36292...271846...1679072....8807722....40232545....163307844
..42..729..10761..125892..1165921...8807722...55960651...306796310...1481748658
..64.1437..26764..387849..4396009..40232545..306796310..2001017650..11403395172
..93.2638..60988.1082111.14863460.163307844.1481748658.11403395172..76084625352
.130.4568.129236.2777103.45791493.598768118.6411737114.57777817522.448101581256

Examples

			Some solutions for n=4 k=4
..0..0..0..1....0..1..2..3....0..0..1..2....0..0..1..1....0..1..2..2
..0..1..1..2....1..2..2..3....1..1..2..2....0..1..1..1....1..1..2..2
..0..1..2..3....2..3..3..4....1..2..2..3....0..1..2..2....1..1..2..2
..1..2..3..4....3..3..3..4....2..2..2..3....1..2..2..3....1..2..2..3
		

Crossrefs

Column 1 is A000125(n-1)

Formula

Empirical for column k:
k=1: a(n) = (1/6)*n^3 - (1/2)*n^2 + (4/3)*n
k=2: [polynomial of degree 6]
k=3: [polynomial of degree 9]
k=4: [polynomial of degree 12]
k=5: [polynomial of degree 15]
k=6: [polynomial of degree 18]
k=7: [polynomial of degree 21]
Empirical for "within 1" instead of "within 3" is T(n,k)=binomial(n+k,k)-1

A252938 T(n,k)=Number of nXk nonnegative integer arrays with upper left 0 and every value within 3 of its king move distance from the upper left and every value increasing by 0 or 1 with every step right, diagonally se or down.

Original entry on oeis.org

1, 2, 2, 4, 5, 4, 8, 13, 13, 8, 15, 34, 44, 34, 15, 26, 83, 153, 153, 83, 26, 42, 176, 494, 711, 494, 176, 42, 64, 329, 1343, 3067, 3067, 1343, 329, 64, 93, 558, 3016, 10920, 17962, 10920, 3016, 558, 93, 130, 879, 5833, 30818, 86488, 86488, 30818, 5833, 879, 130, 176
Offset: 1

Views

Author

R. H. Hardin, Dec 24 2014

Keywords

Comments

Table starts
...1....2.....4......8......15.......26.........42..........64...........93
...2....5....13.....34......83......176........329.........558..........879
...4...13....44....153.....494.....1343.......3016........5833........10114
...8...34...153....711....3067....10920......30818.......70640.......138558
..15...83...494...3067...17962....86488.....320270......917811......2127013
..26..176..1343..10920...86488...578342....2952734....11219797.....32649081
..42..329..3016..30818..320270..2952734...21312696...113154831....440052087
..64..558..5833..70640..917811.11219797..113154831...857248091...4687944300
..93..879.10114.138558.2127013.32649081..440052087..4687944300..36723156004
.130.1308.16179.242764.4211511.76641323.1302939451.18615501830.205553855458

Examples

			Some solutions for n=4 k=4
..0..0..1..2....0..0..1..1....0..1..1..2....0..1..1..1....0..0..0..1
..0..0..1..2....1..1..1..1....0..1..2..2....0..1..2..2....1..1..1..1
..1..1..1..2....1..2..2..2....1..1..2..2....0..1..2..2....1..2..2..2
..1..2..2..2....2..2..2..3....1..2..2..2....1..1..2..3....2..2..2..3
		

Crossrefs

Column 1 is A000125(n-1)

Formula

Empirical for column k:
k=1: a(n) = (1/6)*n^3 - (1/2)*n^2 + (4/3)*n
k=2: a(n) = (8/3)*n^3 - 18*n^2 + (145/3)*n - 42 for n>2
k=3: a(n) = (160/3)*n^3 - 548*n^2 + (6071/3)*n - 2591 for n>4
k=4: a(n) = (4096/3)*n^3 - 18720*n^2 + (269642/3)*n - 149376 for n>6
k=5: a(n) = (133120/3)*n^3 - 760496*n^2 + (13526246/3)*n - 9199709 for n>8
k=6: [polynomial of degree 3] for n>10
k=7: [polynomial of degree 3] for n>12

A039823 a(n) = ceiling( (n^2 + n + 2)/4 ).

Original entry on oeis.org

1, 2, 4, 6, 8, 11, 15, 19, 23, 28, 34, 40, 46, 53, 61, 69, 77, 86, 96, 106, 116, 127, 139, 151, 163, 176, 190, 204, 218, 233, 249, 265, 281, 298, 316, 334, 352, 371, 391, 411, 431, 452, 474, 496, 518, 541, 565, 589, 613, 638, 664, 690, 716, 743, 771, 799, 827
Offset: 1

Views

Author

Keywords

Comments

Equals the number of different coefficient values in the expansion of Product_{i=1..n} (1 + q^1 + ... + q^i). Proof by Lawrence Sze: The Gaussian polynomial Prod_{k=1..n} Sum_{j=0..k} q^j is the q-version of n! and strictly unimodal with constant term 1. It has degree Sum_{k=1..n} k = n(n+1)/2, and thus n(n+1)/2+1 nonzero terms.
a(n) is equivalently the number of different absolute values obtained when summing the first n integers with all possible 2^n sign combinations. - Olivier Gérard, Mar 22 2010
Numbers in ascending order on the central axes (starting with 1) of Ulam's Spiral. - Bob Selcoe, Sep 25 2015

Examples

			Possible absolute values of sums of consecutive integers with any sign combination for n = 4 and n=5 are {0, 2, 4, 6, 8, 10} and {1, 3, 5, 7, 9, 11, 13, 15} respectively. - _Olivier Gérard_, Mar 22 2010
		

Crossrefs

Programs

  • Magma
    [Ceiling((n^2+n+2)/4) : n in [1..80]]; // Wesley Ivan Hurt, Sep 25 2015
    
  • Magma
    I:=[1,2,4,6,8]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Sep 26 2015
  • Maple
    A039823:=n->ceil((n^2+n+2)/4): seq(A039823(n), n=1..100); # Wesley Ivan Hurt, Sep 25 2015
  • Mathematica
    Table[Floor[((n*(n+1)+2)/2+1)/2],{n,5!}] (* Vladimir Joseph Stephan Orlovsky, Apr 26 2010 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {1, 2, 4, 6, 8}, 70] (* Vincenzo Librandi, Sep 26 2015 *)
  • Maxima
    makelist((n*(n+1)+%i^(n*(n+1))+3)/4,n,1,57); /* Bruno Berselli, Jul 25 2012 */
    
  • PARI
    a(n) = ceil((n^2+n+2)/4);
    vector(80, n, a(n)) \\ Altug Alkan, Sep 25 2015
    

Formula

a(n) = floor(binomial(n+1, 2)/2) + 1 = A011848(n+1) + 1.
G.f.: x*(x^4-2*x^3+2*x^2-x+1)/((1+x^2)*(1-x)^3).
a(n) = (n*(n+1)+i^(n*(n+1))+3)/4, where i=sqrt(-1). - Bruno Berselli, Jul 25 2012
a(n) = a(n-1) + A004524(n+1). - Bob Selcoe, Sep 25 2015
a(n) = 3*a(n-1)-4*a(n-2)+4*a(n-3)-3*a(n-4)+a(n-5) for n>5. - Wesley Ivan Hurt, Sep 25 2015
a(n) = ceiling( (n^2+n+1)/4 ). - Bob Selcoe, Sep 26 2015

Extensions

Edited by Ralf Stephan, Nov 15 2004

A090338 Number of ways of arranging n straight lines in general position in the (affine) plane.

Original entry on oeis.org

1, 1, 1, 1, 1, 6, 43, 922, 38609, 3111341
Offset: 0

Views

Author

Jon Wild and Laurence Reeves, Jan 27 2004

Keywords

Comments

This is in the affine plane, rather than the projective plane, so two lines are either parallel or meet in one point.
Here we only consider arrangements of n lines in "general position", with every two lines meeting in one point and every intersection point lying on exactly two lines. See A241600 for the general case.
Two arrangements are considered the same if the lines in each arrangement can be numbered from 1 to n in such a way that, on each line, the order of crossings with the other lines is the same in the two arrangements. In particular, turning over the whole arrangement is allowed. (This does not imply that one arrangement can be continuously changed to the other (possibly after turning over) while keeping all lines straight, without changing the multiplicity of intersection points, and without a line passing through an intersection point, see the papers by Suvorov, Jaggi et al., Richter-Gebert, and Tsukamoto.)
Old name was "Number of full n-flups". The full n-flups are the topologically distinct planar configurations of n straight lines such that each line crosses each other line at exactly one intersection point and no two intersection points coincide.
Also, the number of distinct ways to divide a pancake with n straight cuts that result in the maximal number of pieces (see A000124, A000125).

Examples

			See illustration of a(5), the full pentaflups. Of the six, the last shown does not have reflectional symmetry, but we do not count its mirror image as distinct. All six are drawn with lines at equally-spaced angles; it is usually (but not always) possible to achieve this (41 out of 43 of the full 6-flups, for example, have equi-angled drawings)
		

Crossrefs

Cf. A000124, A000125, A090339 (when the lines need not be straight), A241600, A250001.

Extensions

Edited by Max Alekseyev, May 15 2014
Further edits by N. J. A. Sloane, May 16 2014
a(9) from Christ added, and comments corrected by Günter Rote, Apr 14 2025

A225982 T(n,k)=Number of nXk binary arrays whose sum with another nXk binary array containing no more than two 1s has rows and columns in lexicographically nondecreasing order.

Original entry on oeis.org

2, 4, 4, 8, 15, 8, 15, 48, 48, 15, 26, 138, 252, 138, 26, 42, 350, 1178, 1178, 350, 42, 64, 790, 4722, 9113, 4722, 790, 64, 93, 1616, 16361, 61808, 61808, 16361, 1616, 93, 130, 3049, 49811, 361361, 737893, 361361, 49811, 3049, 130, 176, 5384, 135672, 1825607
Offset: 1

Views

Author

R. H. Hardin May 22 2013

Keywords

Comments

Table starts
...2....4......8........15..........26............42.............64
...4...15.....48.......138.........350...........790...........1616
...8...48....252......1178........4722.........16361..........49811
..15..138...1178......9113.......61808........361361........1825607
..26..350...4722.....61808......737893.......7718077.......69784592
..42..790..16361....361361.....7718077.....148890101.....2513743785
..64.1616..49811...1825607....69784592....2513743785....80901937149
..93.3049.135672...8065278...546720823...36836074434..2279339811483
.130.5384.336189..31631401..3748375290..470279869497.56056577764123
.176.9001.768900.111785599.22776885553.5279223820491

Examples

			Some solutions for n=3 k=4
..0..0..1..1....0..0..1..1....0..1..1..0....1..1..1..1....0..0..1..1
..1..1..1..1....1..1..0..0....0..1..1..0....1..1..1..1....0..0..0..1
..1..0..0..1....0..0..0..1....1..0..0..0....1..0..1..0....1..1..1..1
		

Crossrefs

Column 1 is A000125

Formula

Empirical: columns k=1..5 are polynomials in n of degree 2^k+1 for n>0,0,1,2,2

A055794 Triangle T read by rows: T(i,0)=1 for i >= 0; T(i,i)=1 for i=0,1,2,3; T(i,i)=0 for i >= 4; T(i,j) = T(i-1,j) + T(i-2,j-1) for 1<=j<=i-1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 4, 2, 0, 1, 5, 7, 4, 1, 0, 1, 6, 11, 8, 3, 0, 0, 1, 7, 16, 15, 7, 1, 0, 0, 1, 8, 22, 26, 15, 4, 0, 0, 0, 1, 9, 29, 42, 30, 11, 1, 0, 0, 0, 1, 10, 37, 64, 56, 26, 5, 0, 0, 0, 0, 1, 11, 46, 93, 98, 56, 16, 1, 0, 0, 0, 0, 1, 12, 56, 130, 162, 112, 42, 6, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Clark Kimberling, May 28 2000

Keywords

Comments

T(i+j,j) is the number of strings (s(1),...,s(i+1)) of nonnegative integers s(k) such that 0<=s(k)-s(k-1)<=1 for k=2,3,...,i+1 and s(i+1)=j.
T(i+j,j) is the number of compositions of j consisting of i parts, all of in {0,1}.

Examples

			Triangle begins:
  1;
  1, 1;
  1, 2, 1;
  1, 3, 2, 1;
  1, 4, 4, 2, 0;
  1, 5, 7, 4, 1, 0;
  ...
T(7,4) counts the strings 3334, 3344, 3444, 2234, 2334, 2344, 1234.
T(7,4) counts the compositions 001, 010, 100, 011, 101, 110, 111.
		

Crossrefs

Row sums: A000204 (Lucas numbers).
Cf. subsequences T(2n+m,n): A000125 (m=0, cake numbers), A055795 (m=1), A027660 (m=2), A055796 (m=3), A055797 (m=4), A055798 (m=5), A055799 (m=6).

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return 1;
        elif k=n and n<4 then return 1;
        elif k=n then return 0;
        else return T(n-1,k) + T(n-2,k-1);
        fi; end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Jan 25 2020
  • Magma
    function T(n,k)
      if k eq 0 then return 1;
      elif k eq n and n lt 4 then return 1;
      elif k eq n then return 0;
      else return T(n-1,k) + T(n-2, k-1);
      end if; return T; end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 25 2020
    
  • Maple
    T:= proc(n, k) option remember;
          if k=0 then 1
        elif k=n and n<4 then 1
        elif k=n then 0
        else T(n-1, k) + T(n-2, k-1)
          fi; end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Jan 25 2020
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==n && n<4, 1, If[k==n, 0, T[n-1, k] + T[n-2, k-1] ]]]; Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 25 2020 *)
  • PARI
    T(n,k) = if(k==0, 1, if(k==n && n<4, 1, if(k==n, 0, T(n-1, k) + T(n-2, k-1) )));
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jan 25 2020
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0): return 1
        elif (k==n and n<4): return 1
        elif (k==n): return 0
        else: return T(n-1, k) + T(n-2, k-1)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jan 25 2020
    

Extensions

Typo in definition corrected by Georg Fischer, Dec 03 2021
Previous Showing 41-50 of 80 results. Next