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.

A308505 Counterclockwise square spiral of distinct positive integers constructed by greedy algorithm, such that for p = 2 and 3, every multiple of p (except p itself) is vertically or horizontally adjacent to a cell already holding a multiple of p.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 02 2019

Keywords

Comments

For p = 2 and 3, the set S_p of lattice points holding a multiple of p is connected with respect to von Neumann neighborhood and has interesting graphical features (see representation in Links section).
Apparently this sequence is a permutation of the natural number with infinitely many fixed points.

Examples

			The spiral begins:
  111--105---99---93---87---86---84---82---81---80---78
    |                                                 |
  117   79---75---69---63---57---51---50---48---42   72
    |    |                                       |    |
  119   83   49---47---45---39---33---27---21   36   66
    |    |    |                             |    |    |
  121   85   53   25---23---19---15----9   18   30   60
    |    |    |    |                   |    |    |    |
  125   89   55   29    7----5----3    6   12   24   54
    |    |    |    |    |         |    |    |    |    |
  127   91   59   31   11    1----2   10   26   46   76
    |    |    |    |    |              |    |    |    |
  131   95   61   35   13---17----4----8   22   44   74
    |    |    |    |                        |    |    |
  133   97   65   37---41---43---14---16---20   40   70
    |    |    |                                  |    |
  137  101   67---71---73---77---28---32---34---38   68
    |    |                                            |
  139  103--107--109--113--115---52---56---58---62---64
    |
  143--145--149--151--155--157---88---92---94---98--100
		

Crossrefs

Programs

  • PARI
    See Links section.