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.

Showing 1-10 of 28 results. Next

A056011 Enumeration of natural numbers by the boustrophedonic diagonal method.

Original entry on oeis.org

1, 3, 2, 4, 5, 6, 10, 9, 8, 7, 11, 12, 13, 14, 15, 21, 20, 19, 18, 17, 16, 22, 23, 24, 25, 26, 27, 28, 36, 35, 34, 33, 32, 31, 30, 29, 37, 38, 39, 40, 41, 42, 43, 44, 45, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
Offset: 1

Views

Author

Clark Kimberling, Aug 01 2000

Keywords

Comments

A triangle such that (1) every positive integer occurs exactly once; (2) row n consists of n consecutive numbers; (3) odd-numbered rows are increasing; and (4) even-numbered rows are decreasing.
Self-inverse permutation of the natural numbers.
Mirror image of triangle in A056023. - Philippe Deléham, Apr 04 2009
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers. - Boris Putievskiy, Dec 24 2012
For generalizations see A218890, A213927. - Boris Putievskiy, Mar 10 2013

Examples

			The start of the sequence as a table:
   1,  3,  4, 10, 11, 21, ...
   2,  5,  9, 12, 20, 23, ...
   6,  8, 13, 19, 24, 34, ...
   7, 14, 18, 25, 33, 40, ...
  15, 17, 26, 32, 41, 51, ...
  ...
Enumeration by boustrophedonic ("ox-plowing") diagonal method. - _Boris Putievskiy_, Dec 24 2012
The start of the sequence as triangle array read by rows:
   1;
   3,  2;
   4,  5,  6;
  10,  9,  8,  7;
  11, 12, 13, 14, 15;
  ...
		

Crossrefs

Cf. A079826, A131179 (first column), A218890, A213927.

Programs

  • Haskell
    a056011 n = a056011_tabl !! (n-1)
    a056011_list = concat a056011_tabl
    a056011_tabl = ox False a000027_tabl where
      ox turn (xs:xss) = (if turn then reverse xs else xs) : ox (not turn) xss
    a056011_row n = a056011_tabl !! (n-1)
    -- Reinhard Zumkeller, Nov 08 2013
  • Maple
    A056011 := proc(n,k)
            if type(n,'even') then
                    A131179(n)-k+1 ;
            else
                    A131179(n)+k-1 ;
            end if;
    end proc: # R. J. Mathar, Sep 05 2012
  • Mathematica
    Flatten[If[EvenQ[Length[#]],Reverse[#],#]&/@Table[c=(n(n+1))/2;Range[ c-n+1,c],{n,20}]] (* Harvey P. Dale, Mar 25 2012 *)
    With[{nn=20},{#[[1]],Reverse[#[[2]]]}&/@Partition[ TakeList[ Range[ (nn(nn+1))/2],Range[nn]],2]//Flatten] (* Harvey P. Dale, Oct 05 2021 *)

Formula

a(n) = ((i+j-1)*(i+j-2)+((-1)^t+1)*i - ((-1)^t-1)*j)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012

Extensions

New name from Peter Luschny, Apr 15 2023, based on Boris Putievskiy's comment

A376214 a(n) = A379342(A379343(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 10, 9, 8, 11, 14, 13, 12, 15, 16, 21, 18, 19, 20, 17, 22, 27, 24, 25, 26, 23, 28, 29, 36, 31, 34, 33, 32, 35, 30, 37, 44, 39, 42, 41, 40, 43, 38, 45, 46, 55, 48, 53, 50, 51, 52, 49, 54, 47, 56, 65, 58, 63, 60, 61, 62, 59, 64, 57, 66
Offset: 1

Views

Author

Boris Putievskiy, Feb 05 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. For n > 0, the length of row n is 4n-3 = A016813(n-1).
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A379343 and A378684 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the alternating group A4. The list of the 12 elements of that group: this sequence, A000027 (the identity permutation), A381662, A380817, A379343, A380200, A378684, A379342, A380245, A381664, A380815, A381663. For subgroups and the Cayley table of the group A4 see Boris Putievskiy (2025) link. - Boris Putievskiy, Apr 27 2025
A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral group D4. The list of the 8 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A382679, A376217, A382680. For subgroups and the Cayley table of the group D4 see Boris Putievskiy (2025 D4 (I)) link. - Boris Putievskiy, Apr 27 2025
A378762, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A380817, A382679, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, 383724. For subgroups and the Cayley table of the group D4xC2 see Boris Putievskiy (2025 D4xC2) link. - Boris Putievskiy, May 27 2025

Examples

			Triangle array begins:
  k=    1   2  3  4   5   6   7   8   9
  n=1:  1;
  n=2:  2,  3, 4, 5,  6;
  n=3:  7, 10, 9, 8, 11, 14, 13, 12, 15;
(1, 2, 3, ..., 12, 15) = (1, 2, 3, ..., 12, 15)^(-1).
(1, 2, 3, ..., 12, 15) = (1, 5, 2, ..., 10, 15) (1, 3, 5, ..., 7, 15). The first permutation is from Example A380245 and the second from Example A378684.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6,  8, 15, ...
   2,  5,  9, 12, 20, ...
   4, 10, 13, 19, 26, ...
   7, 14, 18, 25, 33, ...
  11, 21, 24, 34, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1,
  1, 2, 3, 4, 5;
  1, 4, 3, 2, 5, 8, 7, 6, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

a(n) = A380245(A378684(n)).
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n,k) = k if k < m and k == 1 (mod 2), P(n,k) = -k + m + 1 if k < m and k == 0 (mod 2), P(n,k) = k if k >= m and k == 1 (mod 2), P(n,k) = -k + 3m - 1 if k >= m and k == 0 (mod 2), where m = 2n - 1.

Extensions

Name corrected by Pontus von Brömssen, Jun 24 2025

A380817 a(n) = A379343(A380245(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 7, 8, 11, 12, 13, 14, 15, 20, 21, 18, 19, 16, 17, 22, 23, 24, 25, 26, 27, 28, 35, 36, 33, 34, 31, 32, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 54, 55, 52, 53, 50, 51, 48, 49, 46, 47, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
Offset: 1

Views

Author

Boris Putievskiy, Feb 04 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n>1, row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A379343 and A378684 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the alternating group A4. The list of the 12 elements of that group: this sequence, A000027 (the identity permutation), A381662, A376214, A379343, A380200, A378684, A379342, A380245, A381664, A380815, A381663. For subgroups and the Cayley table of the group A4 see Boris Putievskiy (2025) link. - Boris Putievskiy, Apr 17 2025
This sequence and A381968 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral group D4. The list of the 8 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A382679, A376214, A382680. For subgroups and the Cayley table of the group D4 see Putievskiy (D4 (I)) link. - Boris Putievskiy, Jun 09 2025
This sequence, A378762 and A381968 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A382679, A376214, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Putievskiy link. - Boris Putievskiy, Jun 09 2025

Examples

			Triangle array begins:
  k=    1   2   3  4   5   6   7   8   9
  n=1:  1;
  n=2:  2,  3,  4, 5,  6;
  n=3:  9, 10,  7, 8, 11, 12, 13, 14, 15;
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6,  8, 15, ...
   2,  5,  7, 14, 16, ...
   4, 10, 13, 19, 26, ...
   9, 12, 18, 25, 31, ...
  11, 21, 24, 34, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1,
  1, 2, 3, 4, 5;
  3, 4, 1, 2, 5, 6, 7, 8, 9.
All permutations are self-inverse.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

For 1 <= k <= 4n - 3, T(n,k) = A000384(n-1) + P(n,k), P(n,k) = -k + m - 1 if k < m and k == 1 (mod 2), P(n,k) = -k + m + 1 if k < m and k == 0 (mod 2), P(n,k) = k if k >= m, where m = 2*n - 1.

Extensions

Name corrected by Pontus von Brömssen, Jun 24 2025

A381662 a(n) = A378684(A380200(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 11, 14, 13, 12, 15, 20, 17, 18, 19, 16, 21, 22, 27, 24, 25, 26, 23, 28, 35, 30, 33, 32, 31, 34, 29, 36, 37, 44, 39, 42, 41, 40, 43, 38, 45, 54, 47, 52, 49, 50, 51, 48, 53, 46, 55, 56, 65, 58, 63, 60, 61, 62, 59, 64, 57, 66
Offset: 1

Views

Author

Boris Putievskiy, Mar 03 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n>1 row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A379343 and A378684 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the alternating group A4. The list of the 12 elements of that group: this sequence, A000027 (the identity permutation), A380817, A376214, A379343, A380200, A378684, A379342, A380245, A381664, A380815, A381663. For subgroups and the Cayley table of the group A4 see Boris Putievskiy (2025) link. - Boris Putievskiy, Apr 28 2025
A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral group D4. The list of the 8 elements of that group: this sequence, A000027 (the identity permutation), A381968, A382499, A380817, A382679, A376214, A382680. For subgroups and the Cayley table of the group D4 see Boris Putievskiy (2025 D4 (I)) link. - Boris Putievskiy, Apr 28 2025
A378762, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A382499, A380817, A382679, A376214, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Boris Putievskiy (2025 D4xC2) link. - Boris Putievskiy, May 21 2025

Examples

			Triangle array begins:
  k=    1  2  3   4   5   6   7   8   9
  n=1:  1;
  n=2:  2, 3, 4,  5,  6;
  n=3:  9, 8, 7, 10, 11, 14, 13, 12, 15;
(1,2,3,...,12,15) = (1,2,3,...,12,15)^(-1).
(1,2,3,...,12,15) = (1,5,2,...,8,15) (1,3,5,...,9,15). The first permutation is from Example A379342 and the second from Example A379343.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6, 10, 15, ...
   2,  5,  7, 12, 16, ...
   4,  8, 13, 19, 26, ...
   9, 14, 18, 25, 31, ...
  11, 17, 24, 32, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1;
  1, 2, 3, 4, 5;
  3, 2, 1, 4, 5, 8, 7, 6, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

a(n) = A379342(A379343(n)) = A381968(A381968(n)).
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n,k) = - k + m - 1 if k < m and k == 1 (mod 2), P(n,k) = k if k < m and k == 0 (mod 2), P(n,k) = k if k >= m and k == 1 (mod 2), P(n,k) = -k + 3 * m - 1 if k >= m and k == 0 (mod 2), where m = 2n - 1.

Extensions

Name corrected by Pontus von Brömssen, Jun 24 2025

A378762 a(n) = A378200(A378200(A378200(n))).

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 9, 10, 7, 8, 15, 14, 13, 12, 11, 20, 21, 18, 19, 16, 17, 28, 27, 26, 25, 24, 23, 22, 35, 36, 33, 34, 31, 32, 29, 30, 45, 44, 43, 42, 41, 40, 39, 38, 37, 54, 55, 52, 53, 50, 51, 48, 49, 46, 47, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56
Offset: 1

Views

Author

Boris Putievskiy, Dec 06 2024

Keywords

Comments

The sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n>1 row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of natural numbers.
The sequence is an intra-block permutation of the positive integers.
Generalization of Cantor numbering method.
The sequence A378200 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A378200 with itself: A378684(n) = A378200(A378200(n)) = A378200^2(n), a(n) = A378200^3(n), A379342(n) = A378200^4(n), A378705(n) = A378200^5(n). The identity element is A000027(n) = A378200^6(n). - Boris Putievskiy, Jan 15 2025
This sequence, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A380817, A382679, A376214, A382680, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Putievskiy link. - Boris Putievskiy, Jun 09 2025

Examples

			Triangle array begins:
  k=   1   2   3   4   5   6   7   8   9
  n=1: 1;
  n=2: 2,  3,  6,  5,  4;
  n=3: 9, 10,  7,  8, 15, 14, 13, 12, 11;
(1, 2, 3, ..., 12, 11) = (A378200(1), A378200(2), A378200(3), ..., A378200(14), A378200(15))^3.
(1, 2, 3, ..., 12, 11) = (1, 2, 3, ..., 12, 11)^(-1).
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  4,  8, 11, ...
   2,  5,  7, 12, 16, ...
   6, 10, 13, 19, 24, ...
   9, 14, 18, 25, 31, ...
  15, 21, 26, 34, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1;
  1, 2, 5, 4, 3;
  3, 4, 1, 2, 9, 8, 7, 6, 5.
		

Crossrefs

Programs

  • Mathematica
    P[n_,k_]:=Module[{m=2*n-1},If[k
    				

Formula

Linear sequence: (a(1), a(2), ..., a(A000384(n+1))) is a permutation of the positive integers from 1 to A000384(n+1). (a(1), a(2), ..., a(A000384(n+1))) = (A378200(1), A378200(2), ..., A378200(A000384(n+1)))^3. (a(1), a(2), ..., a(A000384(n+1))) = (a(1), a(2), ..., a(A000384(n+1)))^(-1).
Triangular array T(n,k) for 1 <= k <= 4n - 3 (see Example): T(n,k) = A000384(n-1) + P(n,k), P(n,k) = m - k - 1 if k < m and k == 1 (mod 2), P(n, k) = m - k + 1 if k < m and k == 0 (mod 2), P(n, k) = 3m - k - 1 if k >= m, where m = 2n - 1.

A381968 a(a(n)) = A381662(n).

Original entry on oeis.org

1, 5, 3, 4, 2, 6, 14, 8, 12, 10, 11, 7, 13, 9, 15, 27, 17, 25, 19, 23, 21, 22, 16, 24, 18, 26, 20, 28, 44, 30, 42, 32, 40, 34, 38, 36, 37, 29, 39, 31, 41, 33, 43, 35, 45, 65, 47, 63, 49, 61, 51, 59, 53, 57, 55, 56, 46, 58, 48, 60, 50, 62, 52, 64, 54, 66
Offset: 1

Views

Author

Boris Putievskiy, Mar 12 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n > 1 row n joins two consecutive antidiagonals.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
This sequence and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral group D4. The list of the 8 elements of that group: this sequence, A382499 (the inverse permutation), A000027 (the identity permutation), A381662, A380817, A382679, A376214, A382680. For subgroups and the Cayley table of the group D4 see Putievskiy (D4 (I)) link. - Boris Putievskiy, Jun 09 2025
This sequence, A378762 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A382499 (the inverse permutation), A381662, A380817, A382679, A376214, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Putievskiy link. - Boris Putievskiy, Jun 09 2025

Examples

			Triangle array begins:
  k=     1  2   3   4   5   6   7   8   9
  n=1:   1;
  n=2:   5, 3,  4,  2,  6;
  n=3:  14, 8, 12, 10, 11,  7, 13,  9, 15;
(1,5,3,...,9,15) (1,5,3,...,9,15) = (1,2,3,...,12,15). The permutation on the right-hand side is from Example A381662.
ord(1,5,3,...,9,15) = 4.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6, 10, 15, ...
   5,  2, 12,  9, 23, ...
   4,  8, 13, 19, 26, ...
  14,  7, 25, 18, 40, ...
  11, 17, 24, 32, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1;
  4, 2, 3, 1, 5;
  8, 2, 6, 4, 5, 1, 7, 3, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

ord(a(1), a(2), ..., a(A000384(n+1))) = 4, where ord is the order of the permutation.
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n,k) = - k + 2m - 1 if k < m and k == 1 (mod 2), P(n,k) = k if k < m and k == 0 (mod 2), P(n,k) = k if k >= m and k == 1 (mod 2), P(n,k) = k - m if k >= m and k == 0 (mod 2), where m = 2n - 1.

A382499 Inverse permutation to A381968.

Original entry on oeis.org

1, 5, 3, 4, 2, 6, 12, 8, 14, 10, 11, 9, 13, 7, 15, 23, 17, 25, 19, 27, 21, 22, 20, 24, 18, 26, 16, 28, 38, 30, 40, 32, 42, 34, 44, 36, 37, 35, 39, 33, 41, 31, 43, 29, 45, 57, 47, 59, 49, 61, 51, 63, 53, 65, 55, 56, 54, 58, 52, 60, 50, 62, 48, 64, 46, 66
Offset: 1

Views

Author

Boris Putievskiy, Mar 29 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n > 1 row n joins two consecutive antidiagonals.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A381968 and and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral group D4. The list of the 8 elements of that group: this sequence, A381968 (the inverse permutation), A000027 (the identity permutation), A381662, A380817, A382679, A376214, A382680. For subgroups and the Cayley table of the group D4 see Boris Putievskiy (2025 D4 (I)) link. - Boris Putievskiy, Apr 17 2025
A378762, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968 (the inverse permutation), A381662, A380817, A382679, A376214, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Boris Putievskiy (2025 D4xC2) link. - Boris Putievskiy, May 27 2025

Examples

			Triangle array begins:
  k=     1  2   3   4   5  6   7  8   9
  n=1:   1;
  n=2:   5, 3,  4,  2,  6;
  n=3:  12, 8, 14, 10, 11, 9, 13, 7, 15;
(1,5,3,...,7,15)^(-1) = (1,5,3,...,9,15). The permutation on the right-hand side is from Example A381968.
ord(1,5,3,...,7,15) = 4.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6, 10, 15, ...
   5,  2, 14,  7, 27, ...
   4,  8, 13, 19, 26, ...
  12,  9, 25, 18, 42, ...
  11, 17, 24, 32, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1;
  4, 2, 3, 1, 5;
  6, 2, 8, 4, 5, 3, 7, 1, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

ord(a(1), a(2), ..., a(A000384(n+1))) = 4, where ord is the order of the permutation.
T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = k + m if k < m and k == 1 (mod 2), P(n, k) = k if k < m and k == 0 (mod 2), P(n, k) = k if k >= m and k == 1 (mod 2), P(n, k) = -k + 2m - 1 if k >= m and k == 0 (mod 2), where m = 2n - 1.

A382679 a(n) = A381968(A380817(n)).

Original entry on oeis.org

1, 5, 3, 4, 2, 6, 14, 10, 12, 8, 11, 9, 13, 7, 15, 27, 21, 25, 19, 23, 17, 22, 20, 24, 18, 26, 16, 28, 44, 36, 42, 34, 40, 32, 38, 30, 37, 35, 39, 33, 41, 31, 43, 29, 45, 65, 55, 63, 53, 61, 51, 59, 49, 57, 47, 56, 54, 58, 52, 60, 50, 62, 48, 64, 46, 66
Offset: 1

Views

Author

Boris Putievskiy, Apr 03 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n > 1 row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A381968 and and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral Group D4. The list of the 8 elements of that group: this sequence, A382680 (the inverse permutation), A000027 (the identity permutation), A381968, A381662, A382499, A380817, A376214. For subgroups and the Cayley table of the group D4 see Boris Putievskiy (2025 D4 (I)) link. - Boris Putievskiy, Apr 27 2025
A378762, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A380817, A376214, A382680, A378762, A383419, A383589, A383590, A056023, A383722, A383723, 383724. For subgroups and the Cayley table of the group D4xC2 see Boris Putievskiy (2025 D4xC2) link. - Boris Putievskiy, May 27 2025

Examples

			Triangle array begins:
  k=    1   2   3  4   5  6   7  8   9
  n=1:  1;
  n=2:  5,  3,  4, 2,  6;
  n=3: 14, 10, 12, 8, 11, 9, 13, 7, 15;
(1,5,3,...,7,15) = (1,5,3,...,7,15)^(-1).
(1,5,3,...,7,15) = (1,5,3,...,9,15) (1,2,3,...,10,7,...,14,15).  The first permutation on the right-hand side is from Example A381968 and the second from Example A380817.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
   1,  3,  6,  8, 15, ...
   5,  2, 12,  7, 23, ...
   4, 10, 13, 19, 26, ...
  14,  9, 25, 18, 40, ...
  11, 21, 24, 34, 41, ...
  ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1;
  4, 2, 3, 1, 5;
  8, 4, 6, 2, 5, 3, 7, 1, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = 2m - 1 - k if k < m and k == 1 (mod 2), P(n, k) = m + 1 - k if k < m and k == 0 (mod 2), P(n, k) = k if k >= m and k == 1 (mod 2), P(n, k) = 2m - 1 - k if k >= m and k == 0 (mod 2),
where m = 2n - 1.

A382680 a(n) = A382499(A380817(n)).

Original entry on oeis.org

1, 5, 3, 4, 2, 6, 12, 10, 14, 8, 11, 7, 13, 9, 15, 23, 21, 25, 19, 27, 17, 22, 16, 24, 18, 26, 20, 28, 38, 36, 40, 34, 42, 32, 44, 30, 37, 29, 39, 31, 41, 33, 43, 35, 45, 57, 55, 59, 53, 61, 51, 63, 49, 65, 47, 56, 46, 58, 48, 60, 50, 62, 52, 64, 54, 66
Offset: 1

Views

Author

Boris Putievskiy, Apr 03 2025

Keywords

Comments

This sequence can be regarded as a triangular array read by rows. Each row is a permutation of a block of consecutive numbers; the blocks are disjoint and every positive number belongs to some block. The length of row n is 4n-3 = A016813(n-1), n > 0.
The sequence can also be regarded as a table read by upward antidiagonals. For n > 1 row n joins two consecutive antidiagonals.
The sequence is a self-inverse permutation of the positive integers.
In particular, the initial {a(1), a(2), ..., a(A000384(n+1))} is self-inverse.
The sequence is an intra-block permutation of the positive integers.
Generalization of the Cantor numbering method.
A381968 and and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the dihedral Group D4. The list of the 8 elements of that group: this sequence, A382679 (the inverse permutation), A000027 (the identity permutation), A381968, A381662, A382499, A380817, A376214. For subgroups and the Cayley table of the group D4 see Putievskiy (D4 (I)) link. - Boris Putievskiy, Apr 27 2025
A378762, A381968 and A380817 generate via composition a finite non-abelian group of permutations of positive integers, isomorphic to the direct product of the dihedral group D4 and the cyclic group C2. The list of the 16 elements of that group: this sequence, A000027 (the identity permutation), A381968, A381662, A382499, A380817, A382679, A376214, A378762, A383419, A383589, A383590, A056023, A383722, A383723, A383724. For subgroups and the Cayley table of the group D4xC2 see Putievskiy link. - Boris Putievskiy, Jun 02 2025

Examples

			Triangle array begins:
  k=    1   2   3  4   5  6   7  8   9
  n=1:  1;
  n=2:  5,  3,  4, 2,  6;
  n=3: 12, 10, 14, 8, 11, 7, 13, 9, 15;
(1,5,3,...,9,15) = (1,5,3,...,9,15)^(-1).
(1,5,3,...,9,15) = (1,5,3,...,7,15) (1,2,3,...,10,7,...,14,15). The first permutation on the right-hand side is from Example A382499 and the second from Example A380817.
For n > 1, each row of triangle array joins two consecutive upward antidiagonals in the table:
    1,  3,  6,  8, 15, ...
    5,  2, 14,  9, 27, ...
    4, 10, 13, 19, 26, ...
   12,  7, 25, 18, 42, ...
   11, 21, 24, 34, 41, ...
   ...
Subtracting (n-1)*(2*n-3) from each term in row n produces a permutation of numbers from 1 to 4*n-3:
  1,
  4, 2, 3, 1, 5,
  6, 4, 8, 2, 5, 1, 7, 3, 9.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=(n-1)*(2*n-3)+Module[{m=2*n-1},If[k
    				

Formula

T(n,k) for 1 <= k <= 4n - 3: T(n,k) = A000384(n-1) + P(n,k), P(n, k) = m + k if k < m and k == 1 (mod 2), P(n, k) = m - k + 1 if k < m and k == 0 (mod 2), P(n, k) = k if k >= m and k == 1 (mod 2), P(n, k) = - m + k if k >= m and k == 0 (mod 2), where m = 2n - 1.

A373662 a(n) = (1 + (n+1)^2 - (n-2)*(-1)^n)/2.

Original entry on oeis.org

2, 5, 9, 12, 20, 23, 35, 38, 54, 57, 77, 80, 104, 107, 135, 138, 170, 173, 209, 212, 252, 255, 299, 302, 350, 353, 405, 408, 464, 467, 527, 530, 594, 597, 665, 668, 740, 743, 819, 822, 902, 905, 989, 992, 1080, 1083, 1175, 1178, 1274, 1277, 1377, 1380, 1484, 1487, 1595
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 12 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 2 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=2.

Examples

			       [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
  [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
  [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
  [ 3]   6    8   13   19   24   34   39   53   58   76   ...
  [ 4]   7   14   18   25   33   40   52   59   75   ...
  [ 5]  15   17   26   32   41   51   60   74   ...
  [ 6]  16   27   31   42   50   61   73   ...
  [ 7]  28   30   43   49   62   72   ...
  [ 8]  29   44   48   63   71   ...
  [ 9]  45   47   64   70   ...
  [10]  46   65   69   ...
  [11]  66   68   ...
  [12]  67   ...
        ...
		

Crossrefs

For rows k = 1..10: A131179 (k=1) n>0, this sequence (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).
Row n=2 of A056011.
Column k=2 of A056023.

Programs

  • Magma
    [(1 + (n+1)^2 - (n-2)*(-1)^n)/2: n in [1..80]];
    
  • Mathematica
    k := 2; Table[(1 + (n+k-1)^2 + (n-k) (-1)^(n+k-1))/2, {n, 80}]
  • Python
    def A373662(n): return ((n+1)*(n+2)-1 if n&1 else n*(n+1)+5)>>1 # Chai Wah Wu, Jun 23 2024

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = A131179(n+1) + (-1)^n.
G.f.: -x*(2*x^4-3*x^3+3*x+2)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Jun 12 2024
Showing 1-10 of 28 results. Next