login
A376133
Triangle T read by rows: T(n, 1) = (2*n*n - 4*n + 7 + (-1)^n) / 4 and T(n, k) = T(n, k-1) + (-1)^k * 2 * (n+1-k) for k >= 2.
0
1, 2, 4, 3, 7, 5, 6, 12, 8, 10, 9, 17, 11, 15, 13, 14, 24, 16, 22, 18, 20, 19, 31, 21, 29, 23, 27, 25, 26, 40, 28, 38, 30, 36, 32, 34, 33, 49, 35, 47, 37, 45, 39, 43, 41, 42, 60, 44, 58, 46, 56, 48, 54, 50, 52, 51, 71, 53, 69, 55, 67, 57, 65, 59, 63, 61, 62, 84, 64, 82, 66, 80, 68, 78, 70, 76, 72, 74
OFFSET
1,2
COMMENTS
Row n consists of the next n odd/even natural numbers if n is odd/even. So the sequence yields a permutation of the natural numbers.
FORMULA
T(n, k) = (2*n*n + (-1)^k * 4 * (n - k) + 5 + 2 * (-1)^k + (-1)^n) / 4.
T(n, 1) = (2*n*n - 4*n + 7 + (-1)^n) / 4 = A061925(n-1).
T(n, 2) = (2*n*n + 4*n - 1 + (-1)^n) / 4 = A074148(n) for n > 1.
T(n, k) = T(n, k-2) - (-1)^k * 2 for 3 <= k <= n.
G.f.: x*y*(1 + 2*x*y + 2*x^5*y^2 + x^6*y^3 - x^4*y*(3 + y + y^2) - x^2*(1 + y + 3*y^2) + 2*x^3*(1 + y^3))/((1 - x)^3*(1 + x)*(1 - x*y)^3*(1 + x*y)). - Stefano Spezia, Sep 12 2024
EXAMPLE
Row n=5: Next (1,3,5,7 see rows 1 and 3) five odd numbers are 9,11,13,15 and 17; with "9+8-6+4-2" we get 9,17,11,15,13 for row 5.
Row n=8: Next (2,4,..,24 see rows 2, 4 and 6) eight even numbers are 26,28,..,40; with "26+14-12+10-8+6-4+2" we get 26,40,28,38,30,36,32,34 for row 8.
Triangle T(n, k) for 1 <= k <= n starts:
n\ k : 1 2 3 4 5 6 7 8 9 10 11 12
======================================================
1 : 1
2 : 2 4
3 : 3 7 5
4 : 6 12 8 10
5 : 9 17 11 15 13
6 : 14 24 16 22 18 20
7 : 19 31 21 29 23 27 25
8 : 26 40 28 38 30 36 32 34
9 : 33 49 35 47 37 45 39 43 41
10 : 42 60 44 58 46 56 48 54 50 52
11 : 51 71 53 69 55 67 57 65 59 63 61
12 : 62 84 64 82 66 80 68 78 70 76 72 74
etc.
MAPLE
T := (n, k) -> ((-1)^k*(2 + 4*(n - k)) + 2*n^2 + (-1)^n + 5)/4:
seq(seq(T(n, k), k = 1..n), n = 1..12); # Peter Luschny, Sep 13 2024
PROG
(PARI) T(n, k)=(2*n*n+(-1)^k*4*(n-k)+5+2*(-1)^k+(-1)^n)/4
CROSSREFS
Cf. A061925 (column 1), A074148 (column 2), A074149 (row sums), A236283 (main diagonal).
Sequence in context: A340245 A064357 A191735 * A191666 A215673 A352716
KEYWORD
nonn,easy,tabl
AUTHOR
Werner Schulte, Sep 11 2024
STATUS
approved