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-4 of 4 results.

A225590 Primes p such that A217015(p) is a prime number. That is, when applying the walk of a square spiral to the data of rotated-square spiral, on step p a prime number is hit.

Original entry on oeis.org

2, 11, 17, 23, 53, 61, 67, 139, 149, 151, 163, 251, 263, 269, 281, 397, 421, 431, 541, 547, 557, 607, 619, 743, 773, 809, 1021, 1039, 1229, 1279, 1291, 1303, 1361, 1553, 1601, 1619, 1637, 1871, 1901, 1949, 2003, 2239, 2251, 2267, 2281, 2287, 2309, 2311, 2347, 2381, 2393
Offset: 1

Views

Author

Alex Ratushnyak, May 15 2013

Keywords

Comments

Corresponding primes with prime indices, in sorted order: A225754.

Crossrefs

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

A225754 Primes p such that A217296(p) is a prime number. That is, when applying the walk of rotated-square spiral to the data of square spiral, on step p a prime number is hit.

Original entry on oeis.org

5, 11, 13, 29, 31, 41, 67, 71, 73, 79, 127, 137, 193, 199, 211, 293, 313, 421, 499, 503, 619, 631, 647, 661, 673, 773, 811, 967, 991, 1013, 1129, 1163, 1553, 1567, 1597, 1601, 1607, 1747, 1777, 1783, 1789, 1801, 1831, 1861, 1997, 2039, 2053, 2087, 2099, 2113, 2287, 2311
Offset: 1

Views

Author

Alex Ratushnyak, May 15 2013

Keywords

Comments

Corresponding primes with prime indices, in sorted order: A225590. The intersection of a(n) with A225590 begins: 11, 67, 421, 619, 773, 1553, 1601, 2287, 2311, 2381, 2609, 3169, 3181, 3491, 3511, 4157, 4597, 4639, 6263, 7129, 7177, 7193, 8291, 9277.

Crossrefs

A220102 Permutation of natural numbers arising from applying the walk of square spiral (e.g. A214526) to the data of double square spiral (defined in A220098).

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Dec 04 2012

Keywords

Crossrefs

Programs

  • C
    #include 
    #define SIZE 20
    int grid[SIZE][SIZE];
    int direction[] = {0, -1,  1, 0, 0, 1, -1, 0};
    main() {
      int i, j, x1, y1, x2, y2, stepSize;
      int direction1pos=0, direction2pos=4, val;
      x1 = y1 = x2 = y2 = SIZE/2;
      for (val=grid[y1][x1]=1, stepSize=0; ; ++stepSize) {
        if (x1<1 || x1>=SIZE-1 || x2<1 || x2>=SIZE-1) break;
        if (y1<1 || y1>=SIZE-1 || y2<1 || y2>=SIZE-1) break;
        for (i=stepSize|1; i; ++val,--i) {
          x1 += direction[direction1pos  ];
          y1 += direction[direction1pos+1];
          x2 += direction[direction2pos  ];
          y2 += direction[direction2pos+1];
          grid[y1][x1] = val*2;
          grid[y2][x2] = val*2+1;
        }
        direction1pos = (direction1pos+2) & 7;
        direction2pos = (direction2pos+2) & 7;
      }
      direction1pos=0;
      x1 = y1 = SIZE/2;
      for (stepSize=2; ; ++stepSize) {
        for (i=stepSize/2; i; --i) {
          if (grid[y1][x1]==0) return;
          printf("%d, ",grid[y1][x1]);
          x1 += direction[direction1pos  ];
          y1 += direction[direction1pos+1];
        }
        direction1pos = (direction1pos+2) & 7;
      }
    }
Showing 1-4 of 4 results.