Search: a077028
|
| |
|
|
A077028
|
|
The rascal triangle, read by rows: T(n,k) (n >= 0, 0 <= k <= n) = k(n-k) + 1.
|
|
+40
41
|
|
|
|
1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 4, 1, 1, 5, 7, 7, 5, 1, 1, 6, 9, 10, 9, 6, 1, 1, 7, 11, 13, 13, 11, 7, 1, 1, 8, 13, 16, 17, 16, 13, 8, 1, 1, 9, 15, 19, 21, 21, 19, 15, 9, 1, 1, 10, 17, 22, 25, 26, 25, 22, 17, 10, 1, 1, 11, 19, 25, 29, 31, 31, 29, 25, 19, 11, 1, 1, 12, 21, 28, 33, 36, 37, 36, 33, 28, 21, 12, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,5
|
|
|
COMMENTS
|
Pascal's triangle is formed using the rule South = West + East, whereas the rascal triangle uses the rule South = (West*East+1)/North. [Anggoro et al.]
The n-th diagonal is congruent to 1 mod n-1.
Row sums are the cake numbers, A000125. Alternating sum of row n is 0 if n even and (3-n)/2 if n odd. Rows are symmetric, beginning and ending with 1. The number of occurrences of k in this triangle is the number of divisors of k-1, given by A000005.
The triangle can be generated by numbers of the form k*(n-k) + 1 for k = 0 to n. Conjecture: except for n = 0,1 and 6 every row contains a prime. - Amarnath Murthy, Jul 15 2005
Above conjecture needs more exceptions, rows 30 and 54 do not contain primes. - Alois P. Heinz, Aug 31 2017
Consider the semigroup of words in x,y,q subject to the relationships: yx = xyq, qx = xq, qy = yq.
Now take words of length n in x and y, with exactly k y's. If there had been no relationships, the number of different words of this type would be n choose k, sequence A007318. Thanks to the relationships, the number of words of this type is the k-th entry in the n-th row of this sequence (read as a triangle, with the first row indexed by zero and likewise the first entry in each row.)
For example: with three letters and one y, we have three possibilities: xxy, xyx = xxyq, yxx = xxyqq. No two of them are equal, so this entry is still 3, as in Pascal's triangle.
With four letters, two y's, we have the first reduction: xyyx = yxxy = xxyyqq and this is the only reduction for 4 letters. So the middle entry of the fourth row is 5 instead of 6, as in the Pascal triangle. (End)
Main diagonals of this triangle sum to polygonal numbers. See A057145. - Raphie Frank, Oct 30 2012
T(n,k) gives the number of distinct sums of k elements in {1,2,...,n}, e.g., T(5,4) = the number of distinct sums of 4 elements in {1,2,3,4,5}, which is (5+4+3+2) - (4+3+2+1) + 1 = 5. - Derek Orr, Nov 26 2014
Conjecture: excluding the starting and ending 1's in each row, those that contain only prime numbers are n = 2, 3, 5, 7, 13, and 17. Tested up to row 10^9. - Rogério Serôdio, Sep 20 2017
The rascal triangle also uses the rule South = (West+East+1)-North. [Abstracts of AMS, Winter 2019, p. 526, 1145-VS-280, refers to Julian Fleron] - Michael Somos, Jan 12 2019
As a square array read by antidiagonals, selecting terms that give a remainder of 1 when divided by a prime gives evenly sized squares. For example, when each term is divided by 2, showing the remainder looks like:
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1
1 0 1 0 1
T(n,k) is the number of binary words of length n which contain exactly k 1s and have at most 1 ascent. T(n,k) is also the number of ascent sequences avoiding 001 and 210 with length n+1 and exactly k ascents. - Amelia Gibbs, May 21 2024
|
|
|
LINKS
|
A. Anggoro, E. Liu and A. Tulloch, The Rascal Triangle, College Math. J., Vol. 41, No. 5, Nov. 2010, pp. 393-395.
|
|
|
FORMULA
|
As a square array read by antidiagonals, a(n, k) = 1 + n*k. a(n, k) = a(n-1, k) + k. Row n has g.f. (1+(n-1)x)/(1-x)^2, n >= 0. - Paul Barry, Feb 22 2003
Still thinking of square arrays. Let f:N->Z and g:N->Z be given and I an integer, then define a(n, k) = I + f(n)*g(k). Then a(n, k)*a(n-1, k-1) = a(n-1, k)*a(n, k-1) + I*(f(n) - f(n-1))*(g(k) - g(k-1)) for suitable n and k. S= (E*W + 1)/N. arises with I = 1, and f = g = id. - Terry Lindgren, Apr 10 2011
Using the above: Having just read J. Fleron's nice article in Discovering the Art of Mathematics on the rascal triangle, it is neat to note and straightforward to show that when I = 1, a(n, k) + a(n-1, k-1) = a(n-1, k) + a(n, k-1) + (f(n) - f(n-1))*(g(k) - g(k-1)), so with I = 1, and f = g = id, we have S+N = E+W + 1, as his students discovered. - Terry Lindgren, Nov 28 2016
O.g.f. (1 - x*(1 + t) + 2*t*x^2)/((1 - x)^2*(1 - t*x)^2) = 1 + (1 + t)*x + (1 + 2*t + t^2)*x^2 + .... Cf. A105851. - Peter Bala, Jul 26 2015
T(n, k) = 0 if n < k, T(n, 0) = 1, T(n,n) = 1, for n >= 0, and T(n, k) = (T(n-1, k-1)*T(n-1, k) + 1)/(T(n-2, k-1)) for 0 < k < n. See the first comment referring to the triangle with its apex in the middle. - Wolfdieter Lang, Dec 19 2017
|
|
|
EXAMPLE
|
Third diagonal (1,3,5,7,...) consists of the positive integers congruent to 1 mod 2.
The triangle T(n, k) begins:
n\k 0 1 2 3 4 5 6 7 8 9 10 ...
0: 1
1: 1 1
2: 1 2 1
3: 1 3 3 1
4: 1 4 5 4 1
5: 1 5 7 7 5 1
6: 1 6 9 10 9 6 1
7: 1 7 11 13 13 11 7 1
8: 1 8 13 16 17 16 13 8 1
9: 1 9 15 19 21 21 19 15 9 1
10: 1 10 17 22 25 26 25 22 17 10 1
As a square array read by antidiagonals, the first rows are:
1, 1, 1, 1, 1, 1, ...
1, 2, 3, 4, 5, 6, ...
1, 3, 5, 7, 9, 11, ...
1, 4, 7, 10, 13, 16, ...
1, 5, 9, 13, 17, 21, ...
|
|
|
MAPLE
|
if n <0 or k<0 or k > n then
0;
else
k*(n-k)+1 ;
end if;
|
|
|
MATHEMATICA
|
t[n_, k_] := k (n - k) + 1; t[0, 0] = 1; Table[ t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Robert G. Wilson v, Jul 06 2012 *)
|
|
|
PROG
|
(PARI) {T(n, k) = if( k<0 || k>n, 0, k * (n - k) + 1)}; /* Michael Somos, Mar 20 2011 */
|
|
|
CROSSREFS
|
The maximum value for each antidiagonal is given by sequence A033638.
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
Better definition based on Murthy's comment of Jul 15 2005 and the Anggoro et al. paper. - N. J. A. Sloane, Mar 05 2011
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A134394
|
|
Triangle T(n,k) = Sum_{j=k..n} A077028(j,k), read by rows.
|
|
+20
3
|
|
|
|
1, 2, 1, 3, 3, 1, 4, 6, 4, 1, 5, 10, 9, 5, 1, 6, 15, 16, 12, 6, 1, 7, 21, 25, 22, 15, 7, 1, 8, 28, 36, 35, 28, 18, 8, 1, 9, 36, 49, 51, 45, 34, 21, 9, 1, 10, 45, 64, 70, 66, 55, 40, 24, 10, 1, 11, 55, 81, 92, 91, 81, 65, 46, 27, 11, 1, 12, 66, 100, 117, 120, 112, 96, 75, 52, 30, 12, 1, 13, 78, 121, 145, 153
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,2
|
|
|
COMMENTS
|
Row sums = A055795: (1, 3, 7, 15, 30, 56, 98, ...).
|
|
|
LINKS
|
|
|
|
FORMULA
|
|
|
|
EXAMPLE
|
First few rows of the triangle:
1;
2, 1;
3, 3, 1;
4, 6, 4, 1;
5, 10, 9, 5, 1;
6, 15, 16, 12, 6, 1;
7, 21, 25, 22, 15, 7, 1;
|
|
|
MAPLE
|
A077028 := proc(n, k) if n < 0 or k<0 or k > n then 0; else k*(n-k)+1 ; end if; end proc:
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
| |
|
|
|
1, 2, 1, 4, 4, 1, 8, 12, 6, 1, 16, 32, 23, 8, 1, 32, 80, 72, 37, 10, 1, 64, 192, 201, 132, 54, 12, 1, 128, 448, 522, 405, 216, 74, 14, 1, 256, 1024, 1291, 1128, 723, 328, 97, 16, 1, 512, 2304, 3084, 2941, 2154, 1191, 472, 123, 18, 1, 1024, 5120, 7181, 7316, 5920, 3788, 1850, 652, 152, 20, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,2
|
|
|
COMMENTS
|
Row sums = A134396: (1, 3, 9, 27, 80, 232, 656, ...).
|
|
|
LINKS
|
|
|
|
FORMULA
|
|
|
|
EXAMPLE
|
First few rows of the triangle:
1;
2, 1;
4, 4, 1;
8, 12, 6, 1;
16, 32, 23, 8, 1;
32, 80, 72, 37, 10, 1;
...
|
|
|
MAPLE
|
A007318 := proc(n, k) binomial(n, k) ; end: A077028 := proc(i, j) if j <= i then (i-j)*(j-1)+1 ; else 0 ; fi ; end: A134395 := proc(n, m) add(A007318(n, k)*A077028(k+1, m+1), k=0..n) ; end: for n from 0 to 15 do for m from 0 to n do printf("%d, ", A134395(n, m)) ; od: od: # R. J. Mathar, Jun 08 2008
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
| |
|
|
|
1, 1, 2, 1, 5, 4, 1, 10, 17, 8, 1, 19, 51, 49, 16, 1, 36, 134, 196, 129, 32, 1, 69, 330, 650, 645, 321, 64, 1, 134, 783, 1940, 2575, 1926, 769, 128, 1, 263, 1813, 5411, 8995, 8981, 5383, 1793, 256, 1, 520, 4124, 14392, 28742, 35896, 28700, 14344, 4097, 512, 1, 1033, 9252, 36948, 86142, 129150, 129108, 86052, 36873, 9217, 1024
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,3
|
|
|
COMMENTS
|
Let T(r,c) be the array A077028. Fill 2^k numbers in Gaussian templates conforming to the row lengths determined by T(r,c). A110552 results from summing the numbers on each row.
|
|
|
LINKS
|
|
|
|
FORMULA
|
Table entries appear to be given by T(n,k) = binomial(n-2,k-1) + 2^(n-1)*binomial(n-2,k-2), n,k >= 1, leading to the e.g.f. (exp((1+x)*u) - 1)*(x*exp((1+x)*u) + x + 2)/(2*(1+x)^2) = u + (1+2*x)*u^2/2! + (1+5*x+4*x^2)*u^3/3! + .... Cf. A111049. - Peter Bala, Jul 27 2012
|
|
|
EXAMPLE
|
The filled templates begin
1
.1
.2
..1
..2.3
..4
....1
....2.3.5
....4.6.7
....8
therefore the sequence begins
1
1 2
1 5 4
1 10 17 8
...
|
|
|
MATHEMATICA
|
T[n_, k_] := Binomial[n - 2, k - 1] + 2^(n - 1)*Binomial[n - 2, k - 2]; Table[T[n, k], {n, 1, 20}, {k, 1, n}] // Flatten (* G. C. Greubel, Aug 31 2017 *)
|
|
|
PROG
|
(PARI) for(n=1, 20, for(k=1, n, print1(binomial(n - 2, k - 1) + 2^(n - 1)*binomial(n - 2, k - 2), ", "))) \\ G. C. Greubel, Aug 31 2017
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
| |
|
|
|
1, 3, 3, 6, 10, 6, 10, 22, 22, 10, 15, 40, 53, 40, 15, 21, 65, 105, 105, 65, 21, 28, 98, 185, 226, 185, 98, 28, 36, 140, 301, 431, 431, 301, 140, 36, 45, 192, 462, 756, 887, 756, 462, 192, 45, 55, 255, 678, 1246, 1673, 1673, 1246, 678, 255, 55, 66, 330, 960, 1956, 2954
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,2
|
|
|
COMMENTS
|
First term of n-th row is n*(n+1)/2.
Row sum are A002663 (without initial zeros).
Appears to be the triangle resulting from adding the row number (first row numbered 0) of Pascal's triangle (A007318) to each entry in that row, subtracting the corresponding entries in the triangle formed by taking the finite diagonals in the multiplication table in order of increasing length (A003991), and removing the outer two layers, which consist entirely of 0's.
Each value of the sequence T(x,y) is equal to the sum of all values in A014430 that are in the rectangle defined by the tip (0,0) and the position (x,y). - Jon Perry, Sep 11 2013
|
|
|
LINKS
|
|
|
|
FORMULA
|
|
|
|
EXAMPLE
|
Table begins
1;
3, 3;
6, 10, 6;
10, 22, 22, 10;
15, 40, 53, 40, 15;
21, 65, 105, 105, 65, 21;
28, 98, 185, 226, 185, 98, 28;
36, 140, 301, 431, 431, 301, 140, 36;
45, 192, 462, 756, 887, 756, 462, 192, 45;
...
If the zeros are included, the table begins
0;
0, 0;
0, 0, 0;
0, 0, 0, 0;
0, 0, 1, 0, 0;
0, 0, 3, 3, 0, 0;
0, 0, 6, 10, 6, 0, 0;
0, 0, 10, 22, 22, 10, 0, 0;
|
|
|
MATHEMATICA
|
a = Table[Flatten[Table[If[Binomial[m, n] - (1 +n (m - n)) == 0, {}, Binomial[m, n] - (1 + n (m - n))], {n, 0, m}]], {m, 0, 14}]
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
nonn,tabf,uned
|
|
|
AUTHOR
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A134392
|
|
A077028 * A000012, that is Rascal's triangle (as matrix) multiplied by a lower triangular matrix of ones (main diagonal of ones included).
|
|
+20
1
|
|
|
|
1, 2, 1, 4, 3, 1, 8, 7, 4, 1, 15, 14, 10, 5, 1, 26, 25, 20, 13, 6, 1, 42, 41, 35, 26, 16, 7, 1, 64, 63, 56, 45, 32, 19, 8, 1, 93, 92, 84, 71, 55, 38, 22, 9, 1, 130, 129, 120, 105, 86, 65, 44, 25, 10, 1, 176, 175, 165, 148, 126, 101, 75, 50, 28, 11, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,2
|
|
|
COMMENTS
|
|
|
|
LINKS
|
|
|
|
FORMULA
|
Triangle read by rows, partial sums starting from the right of A077028.
|
|
|
EXAMPLE
|
First few rows of the triangle:
1;
2, 1;
4, 3, 1;
8, 7, 4, 1;
15, 14, 10, 5, 1;
26, 25, 20, 13, 6, 1;
42, 41, 35, 26, 16, 7, 1;
...
|
|
|
MATHEMATICA
|
rows = 11;
R[n_, k_] /; k <= n := k (n - k) + 1; R[0, 0] = 1; R[_, _] = 0;
MR = Table[R[n, k], {n, 0, rows-1}, {k, 0, rows-1}];
MB = Table[Boole[0 <= k <= n], {n, 0, rows-1}, {k, 0, rows -1}];
T = MR.MB;
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A338291
|
|
Matrix inverse of the rascal triangle (A077028), read across rows..
|
|
+20
1
|
|
|
|
1, -1, 1, 1, -2, 1, -1, 3, -3, 1, 2, -6, 7, -4, 1, -6, 18, -21, 13, -5, 1, 24, -72, 84, -52, 21, -6, 1, -120, 360, -420, 260, -105, 31, -7, 1, 720, -2160, 2520, -1560, 630, -186, 43, -8, 1, -5040, 15120, -17640, 10920, -4410, 1302, -301, 57, -9, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,5
|
|
|
COMMENTS
|
The columns of this triangle are related to factorial numbers (A000142).
There is a family of triangles T(m;n,k) = 1 + m*k*(n-k) for some fixed integer m (for m >= 0 see A296180, Comments) and 0 <= k <= n. They satisfy the equation T(-m;n,k) = 2 - T(m;n,k). The corresponding matrices inverse M = T^(-1) are given by: M(m;n,n) = 1 for n >= 0, and M(m;n,n-1) = m*(1-n) - 1 for n > 0, and M(m;n,k) = (-1)^(n-k) * m * (m * k*(k+1) + 1) * Product_{i=k+1..n-2} (m*(i+1) - 1) for 0 <= k <= n-2. For special cases of the M(m;n,k) see A338817 (m=-1), and A167374 (m=0), and this triangle (m=1).
|
|
|
LINKS
|
|
|
|
FORMULA
|
T(n,n) = 1 for n >= 0, and T(n,n-1) = -n for n > 0, and T(n,n-2) = n^2 - 3*n + 3 for n > 1, and T(n,k) = (-1)^(n-k) * (k^2 + k + 1) * (n-2)! / k! for 0 <= k <= n-2.
T(n,k) = (2-n) * T(n-1,k) for 0 <= k < n-2.
T(n,k) = T(k+2,k) * (-1)^(n-k) * (n-2)! / k! for 0 <= k <= n-2.
Row sums are A000007(n) for n >= 0.
|
|
|
EXAMPLE
|
The triangle T(n,k) for 0 <= k <= n starts:
n\k : 0 1 2 3 4 5 6 7 8 9
================================================================
0 : 1
1 : -1 1
2 : 1 -2 1
3 : -1 3 -3 1
4 : 2 -6 7 -4 1
5 : -6 18 -21 13 -5 1
6 : 24 -72 84 -52 21 -6 1
7 : -120 360 -420 260 -105 31 -7 1
8 : 720 -2160 2520 -1560 630 -186 43 -8 1
9 : -5040 15120 -17640 10920 -4410 1302 -301 57 -9 1
etc.
|
|
|
PROG
|
(PARI) for(n=0, 10, for(k=0, n, if(k==n, print(" 1"), if(k==n-1, print1(-n, ", "), print1((-1)^(n-k)*(k^2+k+1)*(n-2)!/k!, ", ")))))
(PARI) 1/matrix(10, 10, n, k, n--; k--; if (n>=k, k*(n-k) + 1)) \\ Michel Marcus, Nov 11 2020
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A000125
|
|
Cake numbers: maximal number of pieces resulting from n planar cuts through a cube (or cake): C(n+1,3) + n + 1.
(Formerly M1100 N0419)
|
|
+10
78
|
|
|
|
1, 2, 4, 8, 15, 26, 42, 64, 93, 130, 176, 232, 299, 378, 470, 576, 697, 834, 988, 1160, 1351, 1562, 1794, 2048, 2325, 2626, 2952, 3304, 3683, 4090, 4526, 4992, 5489, 6018, 6580, 7176, 7807, 8474, 9178, 9920, 10701, 11522, 12384, 13288, 14235, 15226
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,2
|
|
|
COMMENTS
|
Note that a(n) = a(n-1) + A000124(n-1). This has the following geometrical interpretation: Define a number of planes in space to be in general arrangement when
(1) no two planes are parallel,
(2) there are no two parallel intersection lines,
(3) there is no point common to four or more planes.
Suppose there are already n-1 planes in general arrangement, thus defining the maximal number of regions in space obtainable by n-1 planes and now one more plane is added in general arrangement. Then it will cut each of the n-1 planes and acquire intersection lines which are in general arrangement. (See the comments on A000124 for general arrangement with lines.) These lines on the new plane define the maximal number of regions in 2-space definable by n-1 straight lines, hence this is A000124(n-1). Each of this regions acts as a dividing wall, thereby creating as many new regions in addition to the a(n-1) regions already there, hence a(n) = a(n-1) + A000124(n-1). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
More generally, we have: A000027(n) = binomial(n,0) + binomial(n,1) (the natural numbers), A000124(n) = binomial(n,0) + binomial(n,1) + binomial(n,2) (the Lazy Caterer's sequence), a(n) = binomial(n,0) + binomial(n,1) + binomial(n,2) + binomial(n,3) (Cake Numbers). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
If Y is a 2-subset of an n-set X then, for n>=3, a(n-3) is the number of 3-subsets of X which do not have exactly one element in common with Y. - Milan Janjic, Dec 28 2007
a(n) is the number of compositions (ordered partitions) of n+1 into four or fewer parts or equivalently the sum of the first four terms in the n-th row of Pascal's triangle. - Geoffrey Critzer, Jan 23 2009
a(n) is also the maximum number of different values obtained by summing n consecutive positive integers with all possible 2^n sign combinations. This maximum is first reached when summing the interval [n, 2n-1]. - Olivier Gérard, Mar 22 2010
a(n) contains only 5 perfect squares > 1: 4, 64, 576, 67600, and 75203584. The incidences of > 0 are given by A047694. - Frank M Jackson, Mar 15 2013
Given n tiles with two values - an A value and a B value - a player may pick either the A value or the B value. The particular tiles are [n, 0], [n-1, 1], ..., [2, n-2] and [1, n-1]. The sequence is the number of different final A:B counts. For example, with n=4, we can have final total [5, 3] = [4, _] + [_, 1] + [_, 2] + [1, _] = [_, 0] + [3, _] + [2, _] + [_, 3], so a(4) = 2^4 - 1 = 15. The largest and smallest final A+B counts are given by A077043 and A002620 respectively. - Jon Perry, Oct 24 2014
For n>=3, a(n) is also the number of maximal cliques in the (n+1)-triangular graph (the 4-triangular graph has a(3)=8 maximal cliques). - Andrew Howroyd, Jul 19 2017
a(n) is the number of binary words of length n matching the regular expression 1*0*1*0*. Coincidentally, A000124 counts binary words of the form 0*1*0*. See Alexandersson and Nabawanda for proof. - Per W. Alexandersson, May 15 2021
For n > 0, let the n-dimensional cube, {0,1}^n be provided with the Hamming distance, d. Given an element x in {0,1}^n, a(n) is the number of elements y in {0,1}^n such that d(x, y) <= 3. Example: n = 4. Let x = (0,0,0,0) be in {0,1}^4.
d(x,y) = 0: y in {(0,0,0,0)}.
d(x,y) = 1: y in {(1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1)}.
d(x,y) = 2: y in {(1,1,0,0), (1,0,1,0), (1,0,0,1), (0,1,1,0), (0,1,0,1), (0,0,1,1)}.
d(x,y) = 3: y in {(1,1,1,0), (1,1,0,1), (1,0,1,1), (0,1,1,1)}.
All these y are at a distance <= 3 from (0,0,0,0), so a(4) = 15. (See Peter C. Heinig's formula). - Yosu Yurramendi, Dec 14 2021
For n >= 2, a(n) is the number of distinct least squares regression lines fitted to n points (j,y_j), 1 <= j <= n, where each y_j is 0 or 1. The number of distinct lines with exactly k 1's among y_1, ..., y_n is A077028(n,k). The number of distinct slopes is A123596(n). - Pontus von Brömssen, Mar 16 2024
|
|
|
REFERENCES
|
V. I. Arnold (ed.), Arnold's Problems, Springer, 2004, comments on Problem 1990-11 (p. 75), pp. 503-510. Numbers N_3.
R. B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 27.
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.
H. E. Dudeney, Amusements in Mathematics, Nelson, London, 1917, page 177.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
T. H. Stickels, Mindstretching Puzzles. Sterling, NY, 1994 p. 85.
W. A. Whitworth, DCC Exercises in Choice and Chance, Stechert, NY, 1945, p. 30.
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)
|
|
|
LINKS
|
Sebastian Mizera and Sabrina Pasterski, Celestial Geometry, arXiv:2204.02505 [hep-th], 2022.
|
|
|
FORMULA
|
a(n) = (n+1)*(n^2-n+6)/6 = (n^3 + 5*n + 6) / 6.
G.f.: (1 - 2*x + 2x^2)/(1-x)^4. - [Simon Plouffe in his 1992 dissertation.]
E.g.f.: (1 + x + x^2/2 + x^3/6)*exp(x).
a(n) = binomial(n,3) + binomial(n,2) + binomial(n,1) + binomial(n,0). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
Paraphrasing the previous comment: the sequence is the binomial transform of [1,1,1,1,0,0,0,...]. - Gary W. Adamson, Oct 23 2007
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
Inverse binomial transform of A134396.
Sum_{n>=0} a(n)/n! = 8*exp(1)/3. (End)
|
|
|
EXAMPLE
|
a(4)=15 because there are 15 compositions of 5 into four or fewer parts. a(6)=42 because the sum of the first four terms in the 6th row of Pascal's triangle is 1+6+15+20=42. - Geoffrey Critzer, Jan 23 2009
For n=5, (1, 3, 5, 7, 9, 11, 13, 17, 19, 21, 23, 25, 35) and their opposite are the 26 different sums obtained by summing 5,6,7,8,9 with any sign combination. - Olivier Gérard, Mar 22 2010
G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 15*x^4 + 26*x^5 + 42*x^6 + 64*x^7 + ... - Michael Somos, Jul 07 2022
|
|
|
MAPLE
|
|
|
|
MATHEMATICA
|
Table[(n^3 + 5 n + 6)/6, {n, 0, 50}] (* Harvey P. Dale, Jan 19 2013 *)
LinearRecurrence[{4, -6, 4, -1}, {1, 2, 4, 8}, 50] (* Harvey P. Dale, Jan 19 2013 *)
|
|
|
PROG
|
(PARI) Vec((1-2*x+2*x^2)/((1-x)^4) + O(x^100)) \\ Altug Alkan, Oct 16 2015
(Python)
def A000125_gen(): # generator of terms
a, b, c = 1, 1, 1
while True:
yield a
a, b, c = a+b, b+c, c+1
|
|
|
CROSSREFS
|
Cf. A000124, A003600, A005408, A016813, A086514, A058331, A002522, A161701-A161705, A000127, A161706-A161708, A080856, A161710-A161713, A161715, A006261, A063865, A051601, A077043, A002620, A123596.
|
|
|
KEYWORD
|
nonn,easy,nice
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A057145
|
|
Square array of polygonal numbers T(n,k) = ((n-2)*k^2 - (n-4)*k)/2, n >= 2, k >= 1, read by antidiagonals upwards.
|
|
+10
69
|
|
|
|
1, 1, 2, 1, 3, 3, 1, 4, 6, 4, 1, 5, 9, 10, 5, 1, 6, 12, 16, 15, 6, 1, 7, 15, 22, 25, 21, 7, 1, 8, 18, 28, 35, 36, 28, 8, 1, 9, 21, 34, 45, 51, 49, 36, 9, 1, 10, 24, 40, 55, 66, 70, 64, 45, 10, 1, 11, 27, 46, 65, 81, 91, 92, 81, 55, 11, 1, 12, 30, 52, 75, 96, 112
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
2,3
|
|
|
COMMENTS
|
T(n,k) is the smallest number that can be expressed as the sum of k consecutive positive integers that differ by n - 2. In other words: T(n,k) is the sum of k terms of the arithmetic progression with common difference n - 2 and 1st term 1, (see the example). - Omar E. Pol, Apr 29 2020
|
|
|
REFERENCES
|
A. H. Beiler, Recreations in the Theory of Numbers. New York: Dover, p. 189, 1966.
J. H. Conway and R. K. Guy, The Book of Numbers, Springer-Verlag (Copernicus), p. 38, 1996.
|
|
|
LINKS
|
|
|
|
FORMULA
|
T(2n+4,n) = n^3. - Stuart M. Ellerstein (ellerstein(AT)aol.com), Aug 28 2000
T(n, k) = T(n-1, k) + k*(k-1)/2 [with T(2, k)=k] = T(n, k-1) + 1 + (n-2)*(k-1) [with T(n, 0)=0] = k + (n-2)k(k-1)/2 = k + A063212(n-2, k-1). - Henry Bottomley, Jul 11 2001
G.f. for row n: x*(1+(n-3)*x)/(1-x)^3, n>=2. - Paul Barry, Feb 21 2003
The triangle is a(n, m) = T(n-m+1, m) = (1/2)*m*(n*(m-1) + 3 - m^2) for n >= 2, m = 1, 2, ..., n-1 and zero elsewhere.
O.g.f. for column m (without leading zeros): (x*binomial(m,2) + (1+2*m-m^2)*(m/2)*(1-x))/(x^(m-1)*(1-x)^2). (End)
G.f.: x^2*y*(1 - x - y + 2*x*y)/((1 - x)^2*(1 - y)^3). - Stefano Spezia, Apr 12 2024
|
|
|
EXAMPLE
|
Array T(n k) (n >= 2, k >= 1) begins:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, ...
1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, ...
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, 176, ...
1, 6, 15, 28, 45, 66, 91, 120, 153, 190, 231, ...
1, 7, 18, 34, 55, 81, 112, 148, 189, 235, 286, ...
1, 8, 21, 40, 65, 96, 133, 176, 225, 280, 341, ...
1, 9, 24, 46, 75, 111, 154, 204, 261, 325, 396, ...
1, 10, 27, 52, 85, 126, 175, 232, 297, 370, 451, ...
1, 11, 30, 58, 95, 141, 196, 260, 333, 415, 506, ...
1, 12, 33, 64, 105, 156, 217, 288, 369, 460, 561, ...
1, 13, 36, 70, 115, 171, 238, 316, 405, 505, 616, ...
1, 14, 39, 76, 125, 186, 259, 344, 441, 550, 671, ...
-------------------------------------------------------
The triangle a(k, m) begins:
k\m 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...
2: 1
3: 1 2
4: 1 3 3
5: 1 4 6 4
6: 1 5 9 10 5
7: 1 6 12 16 15 6
8: 1 7 15 22 25 21 7
9: 1 8 18 28 35 36 28 8
10: 1 9 21 34 45 51 49 36 9
11: 1 10 24 40 55 66 70 64 45 10
12: 1 11 27 46 65 81 91 92 81 55 11
13: 1 12 30 52 75 96 112 120 117 100 66 12
14: 1 13 33 58 85 111 133 148 153 145 121 78 13
15: 1 14 36 64 95 126 154 176 189 190 176 144 91 14
...
-------------------------------------------------------
a(2,1) = T(2,1), a(6, 3) = T(4, 3). (End)
.
Illustration of the corner of the square array:
.
1 2 3 4
O O O O O O O O O O
.
1 3 6 10
O O O O O O O O O O
O O O O O O
O O O
O
.
1 4 9 16
O O O O O O O O O O
O O O O O O
O O O O O O
O O O
O O O
O
O
.
1 5 12 22
O O O O O O O O O O
O O O O O O
O O O O O O
O O O O O O
O O O
O O O
O O O
O
O
O
(End)
|
|
|
MAPLE
|
((n-2)*k^2-(n-4)*k)/2 ;
end proc:
|
|
|
MATHEMATICA
|
nn = 12; Flatten[Table[k (3 - k^2 - n + k*n)/2, {n, 2, nn}, {k, n - 1}]] (* T. D. Noe, Oct 10 2012 *)
|
|
|
PROG
|
(Magma) /* As square array: */ t:=func<n, s | (n^2*(s-2)-n*(s-4))/2>; [[t(s, n): s in [1..11]]: n in [2..14]]; // Bruno Berselli, Jun 24 2013
|
|
|
CROSSREFS
|
Many rows and columns of this array are in the database.
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
Edited: Name shortened, offset in Paul Barry's g.f. corrected and Conway-Guy reference added. - Wolfdieter Lang, Nov 04 2014
|
|
|
STATUS
|
approved
|
| |
|
|
| |
|
|
A287326
|
|
Triangle read by rows: T(n, k) = 6*k*(n-k) + 1; n >= 0, 0 <= k <= n.
|
|
+10
15
|
|
|
|
1, 1, 1, 1, 7, 1, 1, 13, 13, 1, 1, 19, 25, 19, 1, 1, 25, 37, 37, 25, 1, 1, 31, 49, 55, 49, 31, 1, 1, 37, 61, 73, 73, 61, 37, 1, 1, 43, 73, 91, 97, 91, 73, 43, 1, 1, 49, 85, 109, 121, 121, 109, 85, 49, 1, 1, 55, 97, 127, 145, 151, 145, 127, 97, 55, 1, 1, 61, 109, 145, 169, 181, 181, 169, 145, 109, 61, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,5
|
|
|
COMMENTS
|
Let L(m, n, k) = Sum_{r=0..m} A(m, r) * k^r * (n - k)^r.
Then T(n, k) = L(1, n, k), i.e T(n, k) is partial case of L(m, n, k) for m = 1.
T(n, k) is symmetric: T(n, k) = T(n, n-k).
(End)
|
|
|
LINKS
|
|
|
|
FORMULA
|
T(n, k) = 6*k*(n-k) + 1.
G.f. of column k: n^k*(1+(6*k-1)*n)/(1-n)^2.
G.f.: (-1 + 8*y + 5*y^2 + x*(1 - 14*y + y^2))/((-1 + x)^2*(-1 + y)^3). - Stefano Spezia, Oct 09 2018
T(n, k) = 1/2 * T(A294317(n, k), k) + 1/2.
T(n+1, k) = 2*T(n, k) - T(n-1, k), for n >= k.
Sum_{k=0..n-1} T(n, k) = Sum_{k=1..n} T(n, k) = A000578(n).
Sum_{k=1..n-1} T(n, k) = A068601(n).
(n+1)^3 - n^3 = T(A000124(n), 1). (End)
|
|
|
EXAMPLE
|
Triangle begins:
----------------------------------------
k= 0 1 2 3 4 5 6 7 8
----------------------------------------
n=0: 1;
n=1: 1, 1;
n=2: 1, 7, 1;
n=3: 1, 13, 13, 1;
n=4: 1, 19, 25, 19, 1;
n=5: 1, 25, 37, 37, 25, 1;
n=6: 1, 31, 49, 55, 49, 31, 1;
n=7: 1, 37, 61, 73, 73, 61, 37, 1;
n=8: 1, 43, 73, 91, 97, 91, 73, 43, 1;
|
|
|
MAPLE
|
T := (n, k) -> 6*k*(n-k) + 1:
|
|
|
MATHEMATICA
|
T[n_, k_] := 6 k (n - k) + 1; Column[Table[T[n, k], {n, 0, 10}, {k, 0, n}], Center] (* Kolosov Petro, Jun 02 2019 *)
|
|
|
PROG
|
(PARI) t(n, k) = 6*k*(n-k)+1
trianglerows(n) = for(x=0, n-1, for(y=0, x, print1(t(x, y), ", ")); print(""))
/* Print initial 9 rows of triangle as follows */
(GAP) Flat(List([0..11], n->List([0..n], k->6*k*(n-k)+1))); # Muniru A Asiru, Oct 09 2018
(Magma) /* As triangle */ [[6*k*(n-k) + 1: k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Oct 26 2018
|
|
|
CROSSREFS
|
Various cases of L(m, n, k): This sequence (m=1), A300656(m=2), A300785(m=3). See comments for L(m, n, k).
Differences of cubes n^3 are T(A000124(n), 1).
Cf. A000578, A038593, A294317, A007318, A055012, A077028, A008458, A302971, A304042, A068601, A166873, A003154, A227776, A000124, A003215, A094053.
|
|
|
KEYWORD
|
|
|
|
AUTHOR
|
|
|
|
STATUS
|
approved
|
| |
|
Search completed in 0.026 seconds
|