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.

Previous Showing 11-17 of 17 results.

A220516 Nonnegative integers in square maze arrangement T(n,k), read by antidiagonals, n>=0, k>=0.

Original entry on oeis.org

0, 1, 3, 8, 2, 4, 9, 7, 5, 15, 24, 10, 6, 14, 16, 25, 23, 11, 13, 17, 35, 48, 26, 22, 12, 18, 34, 36, 49, 47, 27, 21, 19, 33, 37, 63, 80, 50, 46, 28, 20, 32, 38, 62, 64, 81, 79, 51, 45, 29, 31, 39, 61, 65, 99, 120, 82, 78, 52, 44, 30, 40, 60, 66, 98, 100
Offset: 0

Views

Author

Omar E. Pol, Feb 09 2013

Keywords

Comments

This sequence consists of 0 together with a permutation of the natural numbers. The structure is the same as A081344 but starting with 0, not 1.
It appears that in the n-th layer there is at least a prime number <= g and also there is at least a prime number > g, where g is the number on the main diagonal, the n-th oblong number A002378(n), if n >= 1.

Examples

			The first layer is [1, 2, 3] which looks like this:
.  3,
1, 2,
The second layer is [4, 5, 6, 7, 8] which looks like this:
.  .  4
.  .  5,
8, 7, 6,
Square array T(0,0)..T(10,10) begins:
0,     3,   4,  15,  16,  35,  36,  63,  64,  99, 100,...
1,     2,   5,  14,  17,  34,  37,  62,  65,  98, 101,...
8,     7,   6,  13,  18,  33,  38,  61,  66,  97, 102,...
9,    10,  11,  12,  19,  32,  39,  60,  67,  96, 103,...
24,   23,  22,  21,  20,  31,  40,  59,  68,  95, 104,...
25,   26,  27,  28,  29,  30,  41,  58,  69,  94, 105,...
48,   47,  46,  45,  44,  43,  42,  57,  70,  93, 106,...
49,   50,  51,  52,  53,  54,  55,  56,  71,  92, 107,...
80,   79,  78,  77,  76,  75,  74,  73,  72,  91, 108,...
81,   82,  83,  84,  85,  86,  87,  88,  89,  90, 109,...
120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110,...
...
		

Crossrefs

Main diagonal is A002378.

Formula

a(n) = A081344(n+1) - 1.
T(n,k) = n^2 + k , if n is odd and k<=n.
T(n,k) = n(n + 2) - k, if n is even and k<=n.
T(n,k) = k(k + 2) - n, if n is odd and n
T(n,k) = k^2 + n , if n is even and n

A093650 Natural numbers arranged in a square maze beginning 1, 2, 3, then moving right, then up, right, down, left, down, right, etc., and read by antidiagonals upwards.

Original entry on oeis.org

1, 2, 6, 3, 5, 7, 12, 4, 8, 20, 13, 11, 9, 19, 21, 30, 14, 10, 18, 22, 42, 31, 29, 15, 17, 23, 41, 43, 56, 32, 28, 16, 24, 40, 44, 72, 57, 55, 33, 27, 25, 39, 45, 71, 73, 90, 58, 54, 34, 26, 38, 46, 70, 74, 110, 91, 89, 59, 53, 35, 37, 47, 69, 75, 109, 111
Offset: 1

Author

Michael Joseph Halm, May 15 2004

Keywords

Examples

			a(3) = 6 because the maze begins 2 under 1, 3 under 2, 4 right of 3, 5 right of 2 and 6 right of 1.
Array begins:
   1   6---7  20 ...
   |   |   |   |
   2   5   8  19 ...
   |   |   |   |
   3---4   9  18 ...
           |   |
  12--11--10  17 ...
   |           |
  13--14--15--16 ...
  ...
		

Crossrefs

Other square mazes: A081344, A081349.

Extensions

More terms from Jinyuan Wang, Jun 15 2022

A213928 Natural numbers placed in table T(n,k) layer by layer. The order of placement - at the beginning 2 layers counterclockwise, next 1 layer clockwise and so on. T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 4, 2, 5, 3, 9, 16, 6, 8, 10, 25, 15, 7, 11, 17, 26, 24, 14, 12, 18, 36, 49, 27, 23, 13, 19, 35, 37, 64, 48, 28, 22, 20, 34, 38, 50, 65, 63, 47, 29, 21, 33, 39, 51, 81, 100, 66, 62, 46, 30, 32, 40, 52, 80, 82, 121, 99, 67, 61, 45, 31, 41, 53, 79, 83, 101
Offset: 1

Author

Boris Putievskiy, Mar 06 2013

Keywords

Comments

Permutation of the natural numbers. 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.In general, let b(z) be a sequence of integer numbers. Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Natural numbers placed in table T(n,k) layer by layer. The order of placement - layer is counterclockwise, if b(z) is odd; layer is clockwise if b(z) is even. T(n,k) read by antidiagonals.For A219159 - the order of the placement - at the beginning m layers counterclockwise, next m layers clockwise and so on - b(z)=floor((z-1)/m)+1. For this sequence b(z)=z^2 mod 3.

Examples

			The start of the sequence as table.
The direction of the placement denotes by ">" and  "v".
  ..........v...........v...........v
  >1....4...5..16..25..26..49..64..65...
  >2....3...6..15..24..27..48..63..66...
  .9....8...7..14..23..28..47..62..67...
  >10..11..12..13..22..29..46..61..68...
  >17..18..19..20..21..30..45..60..69...
  .36..35..34..33..32..31..44..59..70...
  >37..38..39..40..41..42..43..58..71...
  >50..51..52..53..54..55..56..57..72...
  .81..80..79..78..77..76..75..74..73...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  4,2;
  5,3,9;
  16,6,8,10;
  25,15,7,11,17;
  26,24,14,12,18,36;
  49,27,23,13,19,35,37;
  64,48,28,22,20,34,38,50;
  65,63,47,29,21,33,39,51,81;
  . . .
		

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if j>=i:
       result=((1+(-1)**(j**2%3-1))*(j**2-i+1)-(-1+(-1)**(j**2%3-1))*((j-1)**2 +i))/2
    else:
       result=((1+(-1)**(i**2%3))*(i**2-j+1)-(-1+(-1)**(i**2%3))*((i-1)**2 +j))/2

Formula

For general case.
As table
T(n,k) = ((1+(-1)^(b(k)-1))*(k^2-n+1)-(-1+(-1)^(b(k)-1))*((k-1)^2 +n))/2, if k >= n;
T(n,k) = ((1+(-1)^b(n))*(n^2-k+1)-(-1+(-1)^b(n))*((n-1)^2 +k))/2, if n >k.
As linear sequence
a(n) = ((1+(-1)^(b(j)-1))*(j^2-i+1)-(-1+(-1)^(b(j)-1))*((j-1)^2 +i))/2, if j >= i;
a(n) = ((1+(-1)^b(i))*(i^2-j+1)-(-1+(-1)^b(i))*((i-1)^2 +j))/2, if i >j;
where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
For this sequence b(z)=z^2 mod 3.
As table
T(n,k) = ((1+(-1)^(k^2 mod 3-1))*(k^2-n+1)-(-1+(-1)^(k^2 mod 3-1))*((k-1)^2 +n))/2, if k >= n;
T(n,k) = ((1+(-1)^(n^2 mod 3))*(n^2-k+1)-(-1+(-1)^(n^2 mod 3))*((n-1)^2 +k))/2, if n >k.
As linear sequence
a(n) = ((1+(-1)^(j^2 mod 3-1))*(j^2-i+1)-(-1+(-1)^(j^2 mod 3-1))*((j-1)^2 +i))/2, if j >= i;
a(n) = ((1+(-1)^(i^2 mod 3))*(i^2-j+1)-(-1+(-1)^(i^2 mod 3))*((i-1)^2 +j))/2, if i >j;
where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A214929 A209293 as table read layer by layer - layer clockwise, layer counterclockwise and so on.

Original entry on oeis.org

1, 3, 4, 2, 5, 9, 14, 7, 6, 10, 11, 20, 23, 17, 12, 8, 13, 19, 26, 34, 43, 30, 27, 16, 15, 21, 22, 35, 38, 53, 58, 48, 39, 31, 24, 18, 25, 33, 42, 52, 63, 75, 88, 69, 64, 47, 44, 29, 28, 36, 37, 54, 57, 76, 81, 102, 109, 95, 82, 70, 59, 49, 40, 32, 41, 51, 62
Offset: 1

Author

Boris Putievskiy, Mar 11 2013

Keywords

Comments

Permutation of the natural numbers.
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.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Table read by boustrophedonic ("ox-plowing") method. Let m be natural number. The order of the list:
T(1,1)=1;
T(2,1), T(2,2), T(1,2);
. . .
T(1,2*m+1), T(2,2*m+1), ... T(2*m,2*m+1), T(2*m+1,2*m+1), T(2*m+1,2*m), ... T(2*m+1,1);
T(2*m,1), T(2*m,2), ... T(2*m,2*m-1), T(2*m,2*m), T(2*m-1,2*m), ... T(1,2*m);
. . .
The first row is layer read clockwise, the second row is layer counterclockwise.

Examples

			The start of the sequence as table:
  1....2...5...8..13..18...
  3....4...9..12..19..24...
  6....7..14..17..26..31...
  10..11..20..23..34..39...
  15..16..27..30..43..48...
  21..22..35..38..53..58...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  3,4,2;
  5,9,14,7,6;
  10,11,20,23,17,12,8;
  13,19,26,34,43,30,27,16,15;
  21,22,35,38,53,58,48,39,31,24,18;
  . . .
Row number r contains 2*r-1 numbers.
		

Crossrefs

Cf. A081344, A209293, A209279, A209278, A185180; table T(n,k) contains: in rows A000982, A097063; in columns A000217, A000124, A000096, A152948, A034856, A152950, A055998, A000982, A097063.

Programs

  • Python
    t=int((math.sqrt(n-1)))+1
    i=(t % 2)*min(t,n-(t-1)**2) + ((t+1) % 2)*min(t,t**2-n+1)
    j=(t % 2)*min(t,t**2-n+1) + ((t+1) % 2)*min(t,n-(t-1)**2)
    m1=int((i+j)/2)+int(i/2)*(-1)**(2*i+j-1)
    m2=int((i+j+1)/2)+int(i/2)*(-1)**(2*i+j-2)
    result=(m1+m2-1)*(m1+m2-2)/2+m1

Formula

As table
T(n,k) = n*n/2+4*(floor((k-1)/2)+1)*n+ceiling((k-1)^2/2), n,k > 0.
As linear sequence
a(n)= (m1+m2-1)*(m1+m2-2)/2+m1, where
m1=floor((i+j)/2) + floor(i/2)*(-1)^(2*i+j-1), m2=int((i+j+1)/2)+int(i/2)*(-1)^(2*i+j-2),
where i=(t mod 2)*min(t; n-(t-1)^2) + (t+1 mod 2)*min(t; t^2-n+1), j=(t mod 2)*min(t; t^2-n+1) + (t+1 mod 2)*min(t; n-(t-1)^2), t=floor(sqrt(n-1))+1.

A363376 Determinant of the n X n matrix formed by placing 1..n^2 in L-shaped gnomons in alternating directions.

Original entry on oeis.org

1, -5, 78, -1200, 19680, -351360, 6854400, -145797120, 3367526400, -84072038400, 2258332876800, -64990937088000, 1995834890649600, -65167516237824000, 2254974602969088000, -82443156980760576000, 3176032637949050880000, -128603097714237898752000, 5460911310769351557120000
Offset: 1

Author

Nicolay Avilov, May 29 2023

Keywords

Comments

The matrix is the upper-left n X n part of the square arrangement in A081344.
Number i is in the matrix at row A220604(i) column A220603(i), for i = 1..n^2.
Conjecture: a(n) has trailing zeros for n > 3. - Stefano Spezia, May 31 2023
The conjecture is true and its proof follows easily from Detlef Meya's formula. - Stefano Spezia, Apr 20 2024

Examples

			         |  1----2    9---10   25 |
         |       |    |    |    | |
         |  4----3    8   11   24 |
         |  |         |    |    | |
  a(5) = |  5----6----7   12   23 | = 19680.
         |                 |    | |
         | 16---15---14---13   22 |
         |  |                   | |
         | 17---18---19---20---21 |
		

Crossrefs

Cf. A081344, A220603, A220604, A363460 (permanent).

Programs

  • Mathematica
    a={}; For[n=1, n<=19, n++,k=i=j=1; M[i,j]=k++; For[h=1, hStefano Spezia, May 31 2023 *)
    a={1};For[n=2,n<20,n++,AppendTo[a,(-1)^(n-1)*2^(n-3)*(2*n*(n-1)+1)*n!]];a (* Detlef Meya, Jun 11 2023 *)

Formula

a(1) = 1, for a > 1: a(n) = (-1)^(n-1)*2^(n-3)*(2*n*(n-1)+1)*(n!). - Detlef Meya, Jun 11 2023
E.g.f.: x*(2 + 7*x + 20*x^2 + 12*x^3)/(2*(1 + 2*x)^3). - Stefano Spezia, Apr 20 2024

Extensions

a(16)-a(19) from Stefano Spezia, May 31 2023

A216253 A213196 as table read layer by layer - layer clockwise, layer counterclockwise and so on.

Original entry on oeis.org

1, 2, 5, 4, 3, 7, 10, 8, 6, 12, 14, 23, 20, 17, 9, 11, 13, 16, 26, 38, 43, 39, 21, 24, 15, 18, 27, 31, 35, 48, 63, 58, 42, 30, 25, 22, 19, 29, 34, 57, 53, 69, 76, 70, 64, 49, 36, 32, 28, 40, 44, 59, 54, 82, 88, 109, 102, 95, 75, 81, 52, 47, 33, 37, 41, 46, 62
Offset: 1

Author

Boris Putievskiy, Mar 15 2013

Keywords

Comments

Permutation of the natural numbers.
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.
Call a "layer" a pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Table read by boustrophedonic ("ox-plowing") method.
Let m be natural number. The order of the list:
T(1,1)=1;
T(2,1), T(2,2), T(1,2);
. . .
T(1,2*m+1), T(2,2*m+1), ... T(2*m,2*m+1), T(2*m+1,2*m+1), T(2*m+1,2*m), ... T(2*m+1,1);
T(2*m,1), T(2*m,2), ... T(2*m,2*m-1), T(2*m,2*m), T(2*m-1,2*m), ... T(1,2*m);
. . .
The first row is layer read clockwise, the second row is layer counterclockwise.

Examples

			The start of the sequence as table:
  1....4...3..11..13...
  2....5...7...9..16...
  6....8..10..17..26...
  12..14..23..20..38...
  15..24..21..39..43...
  . . .
The start of the sequence as triangular array read by rows:
  1;
  2,5,4;
  3,7,10,8,6;
  12,14,23,20,17,9,11;
  13,16,26,38,43,39,21,24,15;
  . . .
Row number r contains 2*r-1 numbers.
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(n-1)))+1
    i=(t % 2)*min(t,n-(t-1)**2) + ((t+1) % 2)*min(t,t**2-n+1)
    j=(t % 2)*min(t,t**2-n+1) + ((t+1) % 2)*min(t,n-(t-1)**2)
    m1=(3*i+j-1-(-1)**i+(i+j-2)*(-1)**(i+j))/4
    m2=((1+(-1)**i)*((1+(-1)**j)*2*int((j+2)/4)-(-1+(-1)**j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)**i)*((1+(-1)**j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)**j)*(1+2*int(j/4))))/4
    m=(m1+m2-1)*(m1+m2-2)/2+m1

Formula

a(n) = (m1+m2-1)*(m1+m2-2)/2+m1, where m1=(3*i+j-1-(-1)^i+(i+j-2)*(-1)^(i+j))/4, m2=((1+(-1)^i)*((1+(-1)^j)*2*int((j+2)/4)-(-1+(-1)^j)*(2*int((i+4)/4)+2*int(j/2)))-(-1+(-1)^i)*((1+(-1)^j)*(1+2*int(i/4)+2*int(j/2))-(-1+(-1)^j)*(1+2*int(j/4))))/4, i=(t mod 2)*min(t; n-(t-1)^2) + (t+1 mod 2)*min(t; t^2-n+1), j=(t mod 2)*min(t; t^2-n+1) + (t+1 mod 2)*min(t; n-(t-1)^2), t=floor(sqrt(n-1))+1.

A363460 a(n) is the permanent of the n X n matrix formed by placing 1..n^2 in L-shaped gnomons in alternating directions.

Original entry on oeis.org

1, 1, 11, 556, 74964, 21700112, 11500685084, 10057140949968, 13496937368200000, 26331147893897760544, 71606290155732170272320, 262516365211410942628577408, 1262517559940020030446967822592, 7786463232979127181938238723356160, 60414239829783205320232261233394491136
Offset: 0

Author

Stefano Spezia, Jun 03 2023

Keywords

Comments

The matrix is the upper-left n X n part of the square arrangement in A081344.
The matrix element k is at row A220604(k) and column A220603(k), for k = 1..n^2.

Examples

			a(5) = 21700112 is the permanent of the 5 X 5 matrix
  |  1----2    9---10   25 |
  |       |    |    |    | |
  |  4----3    8   11   24 |
  |  |         |    |    | |
  |  5----6----7   12   23 |
  |                 |    | |
  | 16---15---14---13   22 |
  |  |                   | |
  | 17---18---19---20---21 |
		

Crossrefs

Cf. A006527 (trace), A037270 (elements sum of the matrix), A060736, A061349 (anti trace), A081344, A220603, A220604, A363376 (determinant).

Programs

  • Mathematica
    a={1}; For[n=1, n<=14, n++,k=i=j=1; M[i,j]=k++; For[h=1, h
    				
Previous Showing 11-17 of 17 results.