%I #12 Dec 04 2023 06:32:10
%S 1,3,2,8,7,4,10,9,6,5,19,18,15,14,11,21,20,17,16,13,12,34,33,30,29,26,
%T 25,22,36,35,32,31,28,27,24,23,53,52,49,48,45,44,41,40,37,55,54,51,50,
%U 47,46,43,42,39,38,76,75,72,71,68,67,64,63,60,59,56,78,77,74,73,70,69,66,65,62,61,58,57
%N Triangle T(n, k) based on A176040 which read by rows yields a permutation of the positive integers.
%F T(n, k) = n*(n+1)/2 + (n-1)*(n mod 2) - 2*k + 3 - (k mod 2) for 1 <= k <= n.
%F T(n, 1) = n*(n+1)/2 + (n-1)*(n mod 2) for n > 0.
%F T(2*n, 1) = A000217(2*n) for n > 0.
%F T(n, k) - T(n, k+1) = A176040(k) for k > 0.
%F T(n, k) = T(n-1, k) + T(n, k-1) - T(n-1, k-1) for 1 < k < n.
%F T(2*n, k) - T(2*n-1, k) = 2 for 1 <= k < 2*n.
%F Row sums: A006003(n) - (-1)^n * 2 * floor((n-1)/2) * (1 + floor((n-1)/2)) for n > 0. - _Werner Schulte_, Dec 03 2023
%e Triangle T(n, k) for 1 <= k <= n begins:
%e n\k: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
%e ==========================================================================
%e 01 : 1
%e 02 : 3 2
%e 03 : 8 7 4
%e 04 : 10 9 6 5
%e 05 : 19 18 15 14 11
%e 06 : 21 20 17 16 13 12
%e 07 : 34 33 30 29 26 25 22
%e 08 : 36 35 32 31 28 27 24 23
%e 09 : 53 52 49 48 45 44 41 40 37
%e 10 : 55 54 51 50 47 46 43 42 39 38
%e 11 : 76 75 72 71 68 67 64 63 60 59 56
%e 12 : 78 77 74 73 70 69 66 65 62 61 58 57
%e 13 : 103 102 99 98 95 94 91 90 87 86 83 82 79
%e 14 : 105 104 101 100 97 96 93 92 89 88 85 84 81 80
%e etc.
%o (PARI) T(n,k) = n*(n+1)/2 + (n-1)*(n%2) - 2*k + 3 - (k%2)
%Y Cf. A000217, A006003, A176040.
%K nonn,easy,tabl
%O 1,2
%A _Werner Schulte_, Jul 21 2023
|