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 A376180 #11 Oct 16 2024 22:30:43 %S A376180 1,4,5,3,6,2,13,12,14,11,15,10,16,9,17,8,18,7,30,29,31,28,32,27,33,26, %T A376180 34,25,35,24,36,23,37,22,38,21,39,20,40,19,58,59,57,60,56,61,55,62,54, %U A376180 63,53,64,52,65,51,66,50,67,49,68,48,69,47,70,46,71,45,72,44,73,43,74,42,75,41,101,102,100,103,99,104,98,105,97,106,96,107 %N A376180 Triangle read by rows (blocks). Each row consists of a permutation of the numbers of its constituents. The length of row number n is the n-th pentagonal number n(3n-1)/2 = A000326(n); see Comments. %C A376180 A209278 presents an algorithm for generating permutations. %C A376180 The sequence is an intra-block permutation of integer positive numbers. %H A376180 Boris Putievskiy, <a href="/A376180/b376180.txt">Table of n, a(n) for n = 1..9126</a> %H A376180 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 A376180 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A376180 Linear sequence: %F A376180 a(n) = P(n) + (L(n)-1)^2*L(n)/2. a(n) = P(n) + A002411(L(n)-1), where P = (L(n)(3L(n) - 1)/2 - R(n) + 2)/2 if R(n) is odd and L(n)(3L(n) - 1)/2 is odd, P = (R(n) + L(n)(3L(n) - 1)/2 + 1)/2 if R(n) is odd and L(n)(3L(n) - 1)/2 is even, P = ceiling((L(n)(3L(n) - 1)/2 + 1)/2) + R(n)/2 if R(n) is even and L(n)(3L(n) - 1)/2 is odd, P = ceiling((L(n)(3L(n) - 1)/2 + 1)/2) - R(n)/2 if R(n) is even and L(n)(3L(n) - 1)/2 is even. L(n) = ceiling(x(n)), x(n) is largest real root of the equation x^2*(x+1)-2*n = 0. %F A376180 Triangular array T(n,k) for 1 <= k <= n(3n-1)/2 (see Example): %F A376180 T(n,k) = P(n,k) + (n-1)^2*n/2, T(n,k) = P(n,k) + A002411(n-1), where P(n,k) = (n(3n - 1)/2 - k + 2)/2 if k is odd and n(3n - 1)/2 is odd, %F A376180 P(n,k) = (k + n(3n - 1)/2 + 1)/2 if k is odd and n(3n - 1)/2 is even, P(n,k) = ceiling((n(3n - 1)/2 + 1)/2) + k/2 if k is even and n(3n - 1)/2 is odd, P(n,k) = ceiling((n(3n - 1)/2 + 1)/2) - k/2 if k is even and n(3n - 1)/2 is even. %e A376180 Triangle begins: %e A376180 k = 1 2 3 4 5 6 7 8 9 10 11 12 %e A376180 n=1: 1; %e A376180 n=2: 4, 5, 3, 6, 2; %e A376180 n=3: 13, 12, 14, 11, 15, 10, 16, 9, 17, 8, 18, 7; %e A376180 Subtracting (n-1)^2*n/2 from each term in row n is a permutation of 1 .. n(3n-1)/2: %e A376180 1; %e A376180 3,4,2,5,1; %e A376180 7,6,8,5,9,4,10,3,11,2,12,1; %t A376180 a[n_]:=Module[{L,R,P,Result},L=Ceiling[Max[x/.NSolve[x^2 (x+1)-2 n==0,x,Reals]]]; %t A376180 R=n-((L-1)^2)*L/2; P=Which[OddQ[R]&&OddQ[L*(3*L-1)/2],(L*(3*L-1)/2-R+2)/2,OddQ[R]&&EvenQ[L*(3*L-1)/2],(R+L*(3*L-1)/2+1)/2,EvenQ[R]&&OddQ[L*(3*L-1)/2],Ceiling[(L*(3*L-1)/2+1)/2]+R/2, EvenQ[R]&&EvenQ[L*(3*L-1)/2],Ceiling[(L*(3*L-1)/2+1)/2]-R/2 ]; %t A376180 Result=P+(L-1)^2*L/2; Result] %t A376180 Nmax=18; Table[a[n],{n,1,Nmax}] %Y A376180 Cf. A000326, A002411, A209278, A375602. %K A376180 nonn,tabf %O A376180 1,2 %A A376180 _Boris Putievskiy_, Sep 14 2024