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.

A385406 Triangle read by rows: T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2).

This page as a plain text file.
%I A385406 #10 Jun 28 2025 12:53:00
%S A385406 1,3,2,5,4,6,9,8,10,7,13,12,14,11,15,19,18,20,17,21,16,25,24,26,23,27,
%T A385406 22,28,33,32,34,31,35,30,36,29,41,40,42,39,43,38,44,37,45,51,50,52,49,
%U A385406 53,48,54,47,55,46,61,60,62,59,63,58,64,57,65,56,66,73,72,74,71,75,70,76,69,77,68,78,67
%N A385406 Triangle read by rows: T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2).
%C A385406 This triangle seen as a sequence yields a permutation of the natural numbers (A000027).
%H A385406 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A385406 T(n, k) = T(n, k-1) - (-1)^k * (k-1) for 1 < k <= n with initial values T(n, 1) = n*(n+1)/2 - floor((n-1)/2) for n >= 1.
%F A385406 T(n, n) = n*(n+1)/2 + (1-n) * (1 - n mod 2) = A128918(n).
%F A385406 T(2*n-1, n) = 2*n^2 - 2*n + 1 - (-1)^n * floor(n/2) = A213399(n-1).
%e A385406 Triangle T(n, k) for 1 <= k <= n starts:
%e A385406 n \k :   1   2   3   4   5   6   7   8   9  10  11  12  13
%e A385406 ==========================================================
%e A385406    1 :   1
%e A385406    2 :   3   2
%e A385406    3 :   5   4   6
%e A385406    4 :   9   8  10   7
%e A385406    5 :  13  12  14  11  15
%e A385406    6 :  19  18  20  17  21  16
%e A385406    7 :  25  24  26  23  27  22  28
%e A385406    8 :  33  32  34  31  35  30  36  29
%e A385406    9 :  41  40  42  39  43  38  44  37  45
%e A385406   10 :  51  50  52  49  53  48  54  47  55  46
%e A385406   11 :  61  60  62  59  63  58  64  57  65  56  66
%e A385406   12 :  73  72  74  71  75  70  76  69  77  68  78  67
%e A385406   13 :  85  84  86  83  87  82  88  81  89  80  90  79  91
%e A385406   etc.
%t A385406 T[n_, k_] := n*(n+1)/2 - Floor[(n-1)/2] - (-1)^k*Floor[k/2]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* _Amiram Eldar_, Jun 28 2025 *)
%o A385406 (PARI) T(n, k) = n*(n+1)/2 - floor((n-1)/2) - (-1)^k * floor(k/2)
%Y A385406 Cf. A080827 (column 1), A128918 (main diagonal), A006003 (row sums), A213399.
%K A385406 nonn,easy,tabl
%O A385406 1,2
%A A385406 _Werner Schulte_, Jun 27 2025