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.
%I A377137 #26 Nov 15 2024 18:20:25 %S A377137 1,4,2,3,6,5,12,10,8,7,9,11,15,13,14,24,22,20,18,16,17,19,21,23,28,26, %T A377137 25,27,40,38,36,34,32,30,29,31,33,35,37,39,45,43,41,42,44,60,58,56,54, %U A377137 52,50,48,46,47,49,51,53,55,57,59,66,64,62,61,63,65,84,82,80,78,76,74,72,70,68,67,69,71,73,75,77,79,81,83,91,89,87,85,86 %N A377137 Array read by rows (blocks). Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. Row n contains 3n/2 elements if n is even, and (n+1)/2 elements if n is odd; ; see Comments. %C A377137 Row n has length A064455(n). The sequence A064455 is non-monotonic. %C A377137 The array consists of two triangular arrays alternating row by row. %C A377137 For odd n, row n consists of permutations of the integers from A001844((n-1)/2) to A265225(n-1). For even n, row n consists of permutations of the integers from A130883(n/2) to A265225(n-1). %C A377137 These permutations are generated by the algorithm described A130517. %C A377137 The sequence is an intra-block permutation of the positive integers. %H A377137 Boris Putievskiy, <a href="/A377137/b377137.txt">Table of n, a(n) for n = 1..9940</a> %H A377137 Boris Putievskiy, <a href="https://arxiv.org/abs/2310.18466">Integer Sequences: Irregular Arrays and Intra-Block Permutations</a>, arXiv:2310.18466 [math.CO], 2023. %H A377137 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A377137 Linear sequence: %F A377137 a(n) = P(n) + B(L(n)-1), where L(n) = ceiling(x(n)), x(n) is largest real root of the equation B(x) - n = 0. B(n) = (n+1)*(2*n-(-1)^n+5)/4 = A265225(n). P(n) = A162630(n)/2. %F A377137 Array T(n,k) (see Example): %F A377137 T(n, k) = P(n, k) + (n^2 - n)/2 if n is even, T(n, k) = P(n, k) + (n^2 - 1)/2 if n is odd, T(n, k) = P(n, k) + A265225(n-1). P(n, k) = |2k - 3n / 2 - 2| if n is even and if 2k <= 3n / 2 + 1, P(n, k) = |2k - 3n / 2 - 1| if n is even and if 2k > 3n / 2 + 1. P(n, k) = |2k - (n + 1) / 2 - 2| if n is odd and if 2k <= (n + 1) / 2 + 1, P(n, k) = |2k - (n + 1) / 2 - 1| if n is odd and if 2k > (n + 1) / 2 + 1. There are several special cases: P(n, 1) = 3n/2 if n is even, P(n, 1) = (n+1)/2 if n is odd. P(2, 2) = 1. P(n, n) = n/2 - 1 if n is even, P(n, n) = (n-3)/2 if n is odd. %e A377137 Array begins: %e A377137 k = 1 2 3 4 5 6 %e A377137 n=1: 1; %e A377137 n=2: 4, 2, 3; %e A377137 n=3: 6, 5; %e A377137 n=4: 12, 10, 8, 7, 9, 11; %e A377137 The triangular arrays alternate by row: n=1 and n=3 comprise one, and n=2 and n=4 comprise the other. %e A377137 Subtracting (n^2 - 1)/2 if n is odd from each term in row n produces a permutation of 1 .. (n+1)/2. Subtracting (n^2 - n)/2 if n is even from each term in row n produces a permutation of 1 .. 3n/2: %e A377137 1, %e A377137 3, 1, 2, %e A377137 2, 1, %e A377137 6, 4, 2, 1, 3, 5, %e A377137 ... %t A377137 a[n_]:=Module[{L,R, P,Result},L=Ceiling[Max[x/.NSolve[x*(2*(x-1)-Cos[Pi*(x-1)]+5)-4*n==0,x,Reals]]]; R=n-If[EvenQ[L],(L^2-L)/2,(L^2-1)/2]; P[(L+1)*(2*L-(-1)^L+5)/4]=If[EvenQ[L],3L/2,(L+1)/2]; P[3]=2; P= Abs[2*R-If[EvenQ[L],3L/2,(L+1)/2]-If[2*R<=If[EvenQ[L],3L/2,(L+1)/2]+1,2,1]]; Res=P+If[EvenQ[L],(L^2-L)/2,(L^2-1)/2]; Result=Res; Result] Nmax= 12; Table[a[n],{n,1,Nmax}] %Y A377137 Cf. A064455, A001844, A130517, A130883, A162630, A265225, A375602, A376180. %K A377137 nonn,tabf %O A377137 1,2 %A A377137 _Boris Putievskiy_, Oct 17 2024