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.

A374494 a(n) = A373498(A373498(n)).

This page as a plain text file.
%I A374494 #21 Apr 26 2025 20:28:45
%S A374494 1,2,3,9,4,6,7,8,5,10,18,13,20,11,15,16,17,14,19,12,21,31,26,33,24,35,
%T A374494 22,28,29,30,27,32,25,34,23,36,48,43,50,41,52,39,54,37,45,46,47,44,49,
%U A374494 42,51,40,53,38,55
%N A374494 a(n) = A373498(A373498(n)).
%C A374494 Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.
%C A374494 Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
%C A374494 The sequence is an intra-block permutation of positive integers.
%C A374494 The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself:  A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6.  - _Boris Putievskiy_, Aug 02 2024
%H A374494 Boris Putievskiy, <a href="/A374494/b374494.txt">Table of n, a(n) for n = 1..9870</a>
%H A374494 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 A374494 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.
%F A374494 Linear sequence:
%F A374494 a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
%F A374494 L(n) = A204164(n), R(n) = n - (L(n)-1)*(2*L(n)-1), P(n) = 2*L(n) + R(n) + 1 if R(n) < 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 2*L(n) - R(n) - 1 if R(n) < 2*L(n)-1 and R(n) mod 2 = 0, P(n) = R(n) if R(n) >= 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 4*L(n) - R(n) if R(n) >= 2*L(n)-1 and R(n) mod 2 = 0.
%F A374494 Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
%F A374494 T(n,k) = (n-1)*(2*n-1) + P(n,k), where P(n,k) = 2*n + k + 1 if k < 2*n-1 and k mod 2 = 1, P(n,k) = 2*n - k - 1 if k < 2*n-1 and k mod 2 = 0, P(n,k) = k if k >= 2*n-1 and k mod 2 = 1, P(n,k) = 4*n - k if k >= 2*n-1 and k mod 2 = 0.
%e A374494 Triangle begins:
%e A374494      k = 1   2   3   4   5   6   7   8   9  10  11
%e A374494   n=1:   1,  2,  3;
%e A374494   n=2:   9,  4,  6,  7,  8,  5, 10;
%e A374494   n=3:  18, 13, 20, 11, 15, 16, 17, 14, 19, 12, 21;
%e A374494 The triangle's rows can be arranged as two successive upward antidiagonals in an array:
%e A374494    1,  3,  6, 10, 15, 21, ...
%e A374494    2,  4,  5, 11, 12, 22, ...
%e A374494    9,  8, 20, 19, 35, 34, ...
%e A374494    7, 13, 14, 24, 25, 39, ...
%e A374494   18, 17, 33, 32, 52, 51, ...
%e A374494   16, 26, 27, 41, 42, 60, ...
%e A374494 Subtracting (n-1)*(2*n-1) from each term in row n is a permutation of 1 .. 4*n-1:
%e A374494    1,2,3,
%e A374494    6,1,3,4,5,2,7,
%e A374494    8,3,10,1,5,6,7,4,9,2,11
%e A374494    ...
%e A374494 The 2nd power of each permutation in example A373498 is equal to the corresponding permutation above:
%e A374494    (2,1,3)^2 = (1,2,3),
%e A374494    (2,6,4,3,5,1,7)^2 = (6,1,3,4,5,2,7),
%e A374494    (2,8,4,10,6,5,7,3,9,1,11)^2 = (8,3,10,1,5,6,7,4,9,2,11).
%t A374494 Nmax=21;
%t A374494 a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
%t A374494 R=n-(L-1)*(2*L-1);
%t A374494 P=Which[R<=2*L-1&&Mod[R,2]==1,R+1,R<=2*L-1&&Mod[R,2]==0,R+2*L,R>2*L-1&&Mod[R,2]==1,R,R>2*L-1&&Mod[R,2]==0,4*L-1-R];
%t A374494 Result=P+(L-1)*(2*L-1);
%t A374494 Result]
%t A374494 Table[a[n],{n,1,Nmax}] (* A373498 *)
%t A374494 Table[a[a[n]],{n,1,Nmax}] (* this sequence *)
%t A374494 Nmax = 21;
%t A374494 a[n_] := Module[{L, R, P, Result}, L = Ceiling[(Sqrt[8*n + 1] - 1)/4];
%t A374494   R = n - (L - 1)*(2*L - 1);
%t A374494   P = Which[R < 2*L - 1 && Mod[R, 2] == 1, 2*L + R + 1, R < 2*L - 1 && Mod[R, 2] == 0, 2*L - R - 1, R >= 2*L - 1 && Mod[R, 2] == 1, R, R >= 2*L - 1 && Mod[R, 2] == 0, 4*L - R];
%t A374494   Result = P + (L - 1)*(2*L - 1);
%t A374494   Result]
%t A374494 Table[a[n], {n, 1, Nmax}]
%Y A374494 Cf. A000027, A004767 (row lengths), A204164, A370655, A373498, A374447, A374531.
%K A374494 nonn,tabf
%O A374494 1,2
%A A374494 _Boris Putievskiy_, Jul 09 2024