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 26 results. Next

A217010 Permutation of natural numbers arising from applying the walk of a square spiral (e.g., A214526) to the data of right triangular type-1 spiral (defined in A214230).

Original entry on oeis.org

1, 2, 13, 3, 5, 6, 7, 8, 9, 10, 12, 32, 61, 33, 14, 4, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 11, 31, 60, 98, 145, 99, 62, 34, 15, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 28, 30, 59, 97, 144, 200, 265, 201, 146, 100, 63, 35, 16, 39, 71
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Examples

			Triangular spiral (A214230) begins:
.
  56
   | \
  55  57
   |     \
  54  29  58
   |   | \   \
  53  28  30  59
   |   |     \   \
  52  27  11  31  60
   |   |   | \   \   \
  51  26  10  12  32  61
   |   |   |     \   \   \
  50  25   9   2  13  33  62
   |   |   |   | \   \   \   \
  49  24   8   1   3  14  34  63
   |   |   |         \   \   \   \
  48  23   7---6---5---4  15  35  64
   |   |                     \   \   \
  47  22--21--20--19--18--17--16  36  65
   |                                 \   \
  46--45--44--43--42--41--40--39--38--37  66
                                             \
  78--77--76--75--74--73--72--71--70--69--68--67
.
Square spiral (defining order in which elements are fetched) begins:
.
  49  26--27--28--29--30--31
   |   |                   |
  48  25  10--11--12--13  32
   |   |   |           |   |
  47  24   9   2---3  14  33
   |   |   |   |   |   |   |
  46  23   8   1   4  15  34
   |   |   |       |   |   |
  45  22   7---6---5  16  35
   |   |               |   |
  44  21--20--19--18--17  36
   |                       |
  43--42--41--40--39--38--37
		

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(0, -1,  1,  1)    # up
        walk( 1, 1, -1,  0)    # right-down
        if posX==SIZE-1:
            break
        walk(-1, 0,  0, -1)    # left
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX:
        walk2(0, -1, 1, 0)    # up
        walk2(1, 0, 0, 1)     # right
        walk2(0, 1, -1, 0)    # down
        walk2(-1, 0, 0, -1)   # left

A217015 Permutation of natural numbers arising from applying the walk of a square spiral (e.g. A214526) to the data of rotated-square spiral (defined in A215468).

Original entry on oeis.org

1, 5, 6, 2, 8, 3, 10, 4, 12, 24, 13, 14, 27, 15, 7, 17, 31, 18, 9, 20, 35, 21, 11, 23, 39, 59, 40, 25, 26, 43, 64, 44, 28, 16, 30, 48, 70, 49, 32, 19, 34, 53, 76, 54, 36, 22, 38, 58, 82, 110, 83, 60, 41, 42, 63, 88, 117, 89, 65, 45, 29, 47, 69, 95, 125, 96, 71, 50
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    posX += 1
    grid[posY*SIZE+posX]=2
    n = 3
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX!=SIZE-1:
        walk(-1,  1, -1, -1)    # down-left
        walk(-1, -1,  1, -1)    # up-left
        walk( 1, -1,  1,  0)    # up-right
        walk( 1,  0,  1,  1)    # right
        walk( 1,  1, -1,  1)    # down-right
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(0, -1, 1, 0)    # up
        walk2(1, 0, 0, 1)     # right
        walk2(0, 1, -1, 0)    # down
        walk2(-1, 0, 0, -1)   # left

A217011 Permutation of natural numbers arising from applying the walk of a square spiral (e.g. A214526) to the data of right triangular type-2 spiral (defined in A214251).

Original entry on oeis.org

1, 5, 19, 6, 8, 9, 10, 2, 3, 4, 18, 41, 73, 42, 20, 7, 24, 25, 26, 27, 28, 11, 12, 13, 14, 15, 17, 40, 72, 113, 163, 114, 74, 43, 21, 23, 49, 50, 51, 52, 53, 54, 55, 29, 30, 31, 32, 33, 34, 35, 16, 39, 71, 112, 162, 221
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(-1, 0,  0, -1)    # left
        walk(0, -1,  1,  1)    # up
        if posY==0:
            break
        walk( 1, 1, -1,  0)    # right-down
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(0, -1, 1, 0)    # up
        walk2(1, 0, 0, 1)     # right
        walk2(0, 1, -1, 0)    # down
        walk2(-1, 0, 0, -1)   # left

A217012 Permutation of natural numbers arising from applying the walk of a square spiral (e.g. A214526) to the data of right triangular type-3 spiral (defined in A214252).

Original entry on oeis.org

1, 8, 25, 9, 2, 3, 4, 5, 6, 7, 24, 50, 85, 51, 26, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 49, 84, 128, 181, 129, 86, 52, 27, 11, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 22, 48, 83, 127, 180, 242
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posY!=0:
        walk( 1, 1, -1,  0)    # right-down
        walk(-1, 0,  0, -1)    # left
        walk(0, -1,  1,  1)    # up
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(0, -1, 1, 0)    # up
        walk2(1, 0, 0, 1)     # right
        walk2(0, 1, -1, 0)    # down
        walk2(-1, 0, 0, -1)   # left

A217013 Permutation of natural numbers arising from applying the walk of a square spiral (e.g. A214526) to the data of triangular horizontal-first spiral (defined in A214250).

Original entry on oeis.org

1, 3, 14, 4, 6, 7, 8, 2, 12, 30, 13, 32, 59, 33, 15, 5, 19, 20, 21, 22, 23, 9, 11, 29, 55, 89, 56, 31, 58, 93, 136, 94, 60, 34, 16, 18, 40, 41, 42, 43, 44, 45, 46, 24, 10, 28, 54, 88, 130, 180, 131, 90, 57, 92, 135, 186, 245, 187, 137, 95, 61, 35, 17, 39, 69
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX
    				

A217014 Permutation of natural numbers arising from applying the walk of a square spiral (e.g. A214526) to the data of triangular horizontal-last spiral (defined in A214226).

Original entry on oeis.org

1, 7, 22, 8, 2, 3, 4, 6, 20, 42, 21, 44, 75, 45, 23, 9, 11, 12, 13, 14, 15, 5, 19, 41, 71, 109, 72, 43, 74, 113, 160, 114, 76, 46, 24, 10, 28, 29, 30, 31, 32, 33, 34, 16, 18, 40, 70, 108, 154, 208, 155, 110, 73, 112, 159, 214
Offset: 1

Views

Author

Alex Ratushnyak, Sep 23 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 33       # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(1,  1, -1,  0)    # down-right
        walk(-1, 0,  1, -1)    # left
        walk(-1, 0,  1, -1)    # left
        if posX<2:
            break
        walk(1, -1,  1,  1)    # up-right
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(0, -1, 1, 0)    # up
        walk2(1, 0, 0, 1)     # right
        walk2(0, 1, -1, 0)    # down
        walk2(-1, 0, 0, -1)   # left

A217296 Permutation of natural numbers arising from applying the walk of rotated-square spiral (defined in A215468) to the data of square spiral (e.g. A214526).

Original entry on oeis.org

1, 4, 6, 8, 2, 3, 15, 5, 19, 7, 23, 9, 11, 12, 14, 34, 16, 18, 40, 20, 22, 46, 24, 10, 28, 29, 13, 33, 61, 35, 17, 39, 69, 41, 21, 45, 77, 47, 25, 27, 53, 54, 30, 32, 60, 96, 62, 36, 38, 68, 106, 70, 42, 44, 76, 116, 78, 48, 26, 52, 86, 87, 55, 31, 59, 95, 139
Offset: 1

Views

Author

Alex Ratushnyak, Sep 30 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 29    # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX:
        walk(0, -1, 1, 0)    # up
        walk(1, 0, 0, 1)     # right
        walk(0, 1, -1, 0)    # down
        walk(-1, 0, 0, -1)   # left
    grid2 = [0] * (SIZE*SIZE)
    posY = SIZE//2
    posX = posY+1
    grid2[posY*SIZE+posX-1] = grid2[posY*SIZE+posX] = 1
    print(1, end=',')
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            raise ValueError
        print(a, end=',')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX!=SIZE-1:
        walk2(-1,  1, -1, -1)    # down-left
        walk2(-1, -1,  1, -1)    # up-left
        walk2( 1, -1,  1,  0)    # up-right
        walk2( 1,  0,  1,  1)    # right
        walk2( 1,  1, -1,  1)    # down-right

A217291 Permutation of natural numbers arising from applying the walk of right triangular type-1 spiral (defined in A214230) to the data of square spiral (e.g. A214526).

Original entry on oeis.org

1, 2, 4, 16, 5, 6, 7, 8, 9, 10, 27, 11, 3, 15, 35, 63, 36, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 51, 84, 52, 28, 12, 14, 34, 62, 98, 142, 99, 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 83, 124, 173, 125, 85, 53, 29, 13, 33, 61, 97, 141, 193, 253
Offset: 1

Views

Author

Alex Ratushnyak, Sep 30 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 29    # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX:
        walk(0, -1, 1, 0)    # up
        walk(1, 0, 0, 1)     # right
        walk(0, 1, -1, 0)    # down
        walk(-1, 0, 0, -1)   # left
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(0, -1,  1,  1)    # up
        walk2( 1, 1, -1,  0)    # right-down
        if posX==SIZE-1:
            break
        walk2(-1, 0,  0, -1)    # left

A217292 Permutation of natural numbers arising from applying the walk of right triangular type-2 spiral (defined in A214251) to the data of square spiral (e.g. A214526).

Original entry on oeis.org

1, 8, 9, 10, 2, 4, 16, 5, 6, 7, 22, 23, 24, 25, 26, 51, 27, 11, 3, 15, 35, 63, 36, 17, 18, 19, 20, 21, 44, 45, 46, 47, 48, 49, 50, 83, 124, 84, 52, 28, 12, 14, 34, 62, 98, 142, 99, 64, 37, 38, 39, 40, 41, 42, 43, 74, 75, 76, 77, 78, 79, 80, 81, 82, 123, 172, 229
Offset: 1

Views

Author

Alex Ratushnyak, Sep 30 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 29    # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX:
        walk(0, -1, 1, 0)    # up
        walk(1, 0, 0, 1)     # right
        walk(0, 1, -1, 0)    # down
        walk(-1, 0, 0, -1)   # left
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk2(-1, 0,  0, -1)    # left
        walk2(0, -1,  1,  1)    # up
        if posY==0:
            break
        walk2( 1, 1, -1,  0)    # right-down

A217293 Permutation of natural numbers arising from applying the walk of right triangular type-3 spiral (defined in A214252) to the data of square spiral (e.g. A214526).

Original entry on oeis.org

1, 5, 6, 7, 8, 9, 10, 2, 4, 16, 36, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 51, 27, 11, 3, 15, 35, 63, 99, 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 83, 124, 84, 52, 28, 12, 14, 34, 62, 98, 142, 194, 143, 100, 65, 66, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Alex Ratushnyak, Sep 30 2012

Keywords

Crossrefs

Programs

  • Python
    SIZE = 29    # must be 4k+1
    grid = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        n+=1
        if grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posX:
        walk(0, -1, 1, 0)    # up
        walk(1, 0, 0, 1)     # right
        walk(0, 1, -1, 0)    # down
        walk(-1, 0, 0, -1)   # left
    import sys
    grid2 = [0] * (SIZE*SIZE)
    posX = posY = SIZE//2
    grid2[posY*SIZE+posX]=1
    def walk2(stepX, stepY, chkX, chkY):
      global posX, posY
      while 1:
        a = grid[posY*SIZE+posX]
        if a==0:
            sys.exit(1)
        print(a, end=', ')
        posX+=stepX
        posY+=stepY
        grid2[posY*SIZE+posX]=1
        if grid2[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while posY!=0:
        walk2( 1, 1, -1,  0)    # right-down
        walk2(-1, 0,  0, -1)    # left
        walk2(0, -1,  1,  1)    # up
Showing 1-10 of 26 results. Next