login
A357734
Array T(n,k), read by descending antidiagonals, whose rows are numbers congruent to p or q mod r, with 0 <= p < q < r, sorted by r, then p, then q.
1
0, 1, 0, 2, 1, 0, 3, 3, 2, 1, 4, 4, 3, 2, 0, 5, 6, 5, 4, 1, 0, 6, 7, 6, 5, 4, 2, 0, 7, 9, 8, 7, 5, 4, 3, 1, 8, 10, 9, 8, 8, 6, 4, 2, 1, 9, 12, 11, 10, 9, 8, 7, 5, 3, 2, 10, 13, 12, 11, 12, 10, 8, 6, 5, 3, 0, 11, 15, 14, 13, 13, 12, 11, 9, 7, 6, 1, 0
OFFSET
1,4
COMMENTS
When r is even, there are r/2 rows for which q - p = r/2. The definition reduces to "numbers congruent to p mod r/2" for these rows. They are kept here for the sake of completeness.
The coefficients in the a(k) formula match those in the e.g.f. If we start with the a(k) formula we get the constant of the e.g.f. by setting a(0)=0.
The sum of two rows with the same r is a row. In fact (using nonnegative integers), any linear combination of rows with the same r yields a row. The same linear combination applied to p, q and r for the rows gives P, Q and R for the combined row. The linear combination also links the steps for the rows with the steps for the combined row.
LINKS
David Lovler, Table of n, a(n) for n = 1..9316 (First 136 antidiagonals).
FORMULA
T(n,k) = T(n,k-1) + T(n,k-2) - T(n,k-3), k > 3.
Each row has the following formulas given p,q,r for the row.
If the row offsets are 1,
a(k) = (2*r*k + 2*p + 2*q - 3*r - (2*p - 2*q + r)*(-1)^k)/4.
G.f.: x*(p + (q - p)*x + (r - q)*x^2) / ((1 + x)*(x - 1)^2).
E.g.f.: r - q + ((2*r*x + 2*p + 2*q - 3*r)*exp(x) - (2*p - 2*q + r)*exp(-x))/4.
If the row offsets are 0,
a(k) = (2*r*k + 2*p + 2*q - r + (2*p - 2*q + r)*(-1)^k)/4.
G.f.: (p + (q - p)*x + (r - q)*x^2) / ((1 + x)*(x - 1)^2).
E.g.f.: ((2*r*x + 2*p + 2*q - r)*exp(x) + (2*p - 2*q + r)*exp(-x))/4.
EXAMPLE
T(n,k) begins
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 congruent to 0 or 1 mod 2
0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21 congruent to 0 or 1 mod 3
0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21 congruent to 0 or 2 mod 3
1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22 congruent to 1 or 2 mod 3
0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28 congruent to 0 or 1 mod 4
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 congruent to 0 or 2 mod 4
0, 3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 23, 24, 27, 28 congruent to 0 or 3 mod 4
1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 29 congruent to 1 or 2 mod 4
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29 congruent to 1 or 3 mod 4
2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30 congruent to 2 or 3 mod 4
Row 84 (A047319) with p,q,r = 5,6,7 begins
5, 6, 12, 13, 19, 20, 26, 27, 33, 34, 40, 41, 47, 48, 54, 55, 61, 62, 68, 69.
With offset 1 this row has the following formulas.
a(k) = (2*r*k + 2*p + 2*q - 3*r - (2*p - 2*q + r)*(-1)^k)/4
= (2*7*k + 2*5 + 2*6 - 3*7 - (2*5 - 2*6 + 7)*(-1)^k)/4
= (14*k + 1 - 5*(-1)^k)/4.
G.f.: x*(p + (q - p)*x + (r - q)*x^2) / ((1 + x)*(x - 1)^2)
= x*(5 + (6 - 5)*x + (7 - 6)*x^2) / ((1 + x)*(x - 1)^2)
= x*(5 + x + x^2) / ((1 + x)*(x - 1)^2).
E.g.f.: r - q + ((2*r*x + 2*p + 2*q - 3*r)*exp(x) - (2*p - 2*q + r)*exp(-x))/4
= 7 - 6 + ((2*7*x + 2*5 + 2*6 - 3*7)*exp(x) - (2*5 - 2*6 + 7)*exp(-x))/4
= 1 + ((14*x + 1)*exp(x) - 5*exp(-x))/4.
Example of a linear combination of rows.
For r=3, the rows are
0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15 congruent to 0 or 1 mod 3 steps [1, 2]
0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15 congruent to 0 or 2 mod 3 steps [2, 1]
1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16 congruent to 1 or 2 mod 3 steps [1, 2].
L={2,3,7} applied to the above three rows yields
7, 22, 43, 58, 79, 94, 115, 130, 151, 166, 187 congruent to 7 or 22 mod 36.
L for steps. 2*[1,2] + 3*[2,1] + 7*[1,2] = [2,4] + [6,3] + [7,14] = [15,21].
PROG
(PARI) {for(r=2, 10, for(p=0, r-2, for(q=p+1, r-1, print1(p, " or ", q, " mod ", r, " ");
forstep(i=p, 10*r, [q-p, r-q+p], print1(i", ")); print)))}
(PARI) M=[0..19];
{for(r=3, 6, for(p=0, r-2, for(q=p+1, r-1, newrow=List();
for(k=1, 20, listput(newrow, (2*r*k + 2*p + 2*q - 3*r - (2*p - 2*q + r)*(-1)^k)/4; ));
M=matconcat([M; Vec(newrow)]))));
T(n, k)=M[n, k]; }
M
CROSSREFS
The first column is A144629.
Sequence in context: A290733 A113020 A347277 * A228821 A336932 A127258
KEYWORD
nonn,tabl,easy
AUTHOR
David Lovler, Oct 11 2022
STATUS
approved