

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.


2



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


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.


LINKS

Table of n, a(n) for n=1..67.
Rémy Sigrist, Representation of S_2 restricted to 500 <= x <= +500 and 500 <= y <= +500
Rémy Sigrist, Representation of S_3 restricted to 500 <= x <= +500 and 500 <= y <= +500
Rémy Sigrist, Colored representation of (a(n)n) restricted to 500 <= x <= +500 and 500 <= y <= +500 (where black pixels correspond to zeros, blue shades correspond to negative values and red shades correspond to positive values)
Rémy Sigrist, PARI program for A308505


EXAMPLE

The spiral begins:
111105999387868482818078
 
117 797569635751504842 72
   
119 83 49474539332721 36 66
     
121 85 53 252319159 18 30 60
       
125 89 55 29 753 6 12 24 54
         
127 91 59 31 11 12 10 26 46 76
        
131 95 61 35 131748 22 44 74
      
133 97 65 374143141620 40 70
    
137 101 6771737728323438 68
  
139 1031071091131155256586264

14314514915115515788929498100


PROG

(PARI) See Links section.


CROSSREFS

Cf. A005843, A008585.
Sequence in context: A020625 A033633 A242119 * A338938 A249823 A171049
Adjacent sequences: A308502 A308503 A308504 * A308506 A308507 A308508


KEYWORD

nonn


AUTHOR

Rémy Sigrist, Jun 02 2019


STATUS

approved



