A337108 Square spiral constructed by greedy algorithm, so that each diagonal and antidiagonal contains distinct numbers.
0, 0, 1, 1, 1, 0, 2, 1, 2, 2, 0, 2, 3, 3, 2, 3, 3, 2, 0, 2, 4, 3, 1, 3, 4, 4, 3, 0, 4, 4, 5, 5, 5, 1, 4, 5, 5, 4, 5, 0, 3, 4, 6, 5, 5, 1, 6, 5, 6, 6, 5, 6, 0, 6, 3, 6, 7, 7, 4, 7, 1, 7, 6, 7, 7, 6, 3, 6, 0, 6, 7, 6, 8, 7, 8, 7, 1, 7, 4, 7, 8, 8, 7, 4, 2, 0, 2
Offset: 0
Keywords
Examples
The spiral begins: 7----7----6----7----1----7----4----7----7 | | 6 5----5----4----1----5----5----5 6 | | | | 3 4 3----3----2----3----3 4 3 | | | | | | 6 5 2 1----1----1 2 4 6 | | | | | | | | 0 0 0 0 0----0 0 0 0 | | | | | | | 6 3 2 2----1----2----2 3 6 | | | | | 7 4 4----3----1----3----4----4 5 | | | 6 6----5----5----1----6----5----6----6 | 8----7----8----7----1----7----4----7----8
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10200
- Rémy Sigrist, Colored representation of the spiral for -512 <= x, y <= 512
- Rémy Sigrist, Colored representation of the spiral for -512 <= x, y <= 512 and x any y have the same parity
- Rémy Sigrist, Colored representation of the spiral for -512 <= x, y <= 512 and x and y have different parity
- Rémy Sigrist, PARI program for A337108
Programs
-
PARI
\\ See Links section.
Formula
a(n) = 0 iff n belongs to A035608.
Comments