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.

A307834 Counterclockwise square spiral constructed by greedy algorithm such that the sum of the values of any two vertically or horizontally adjacent cells is unique.

Original entry on oeis.org

0, 0, 1, 2, 2, 5, 1, 8, 10, 1, 12, 13, 2, 15, 17, 18, 3, 20, 19, 25, 2, 27, 22, 21, 32, 2, 35, 26, 28, 38, 4, 43, 31, 31, 32, 48, 4, 52, 37, 39, 34, 58, 6, 63, 40, 46, 49, 39, 70, 5, 76, 42, 56, 51, 45, 80, 5, 86, 44, 62, 66, 67, 46, 96, 5, 100, 50, 71, 72, 76
Offset: 0

Views

Author

Rémy Sigrist, May 01 2019

Keywords

Comments

Visually, we have a superposition of two images that we can separate by considering the parity of the sum of the x and y coordinates (see illustrations in Links section).

Examples

			The spiral begins:
    8--158---69--111---91---95---93--110---61--147----6
    |                                                 |
  164    5---96---46---67---66---62---44---86----5  140
    |    |                                       |    |
   67  100    4---48---32---31---31---43----4   80   64
    |    |    |                             |    |    |
  123   50   52    3---18---17---15----2   38   45   96
    |    |    |    |                   |    |    |    |
   97   71   37   20    2----2----1   13   28   51   88
    |    |    |    |    |         |    |    |    |    |
  102   72   39   19    5    0----0   12   26   56   82
    |    |    |    |    |              |    |    |    |
   99   76   34   25    1----8---10----1   35   42   94
    |    |    |    |                        |    |    |
  123   56   58    2---27---22---21---32----2   76   55
    |    |    |                                  |    |
   71  106    6---63---40---46---49---39---70----5  130
    |    |                                            |
  172    9--110---54---80---76---75---84---56--122----7
    |
   10--182---73--133--109--117--120--112--141---76--193
		

Crossrefs

See A307838 for the multiplicative variant.

Programs

  • PARI
    See Links section.