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

%I #23 Jun 18 2019 11:57:23

%S 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,

%T 26,28,38,4,43,31,31,32,48,4,52,37,39,34,58,6,63,40,46,49,39,70,5,76,

%U 42,56,51,45,80,5,86,44,62,66,67,46,96,5,100,50,71,72,76

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

%C 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).

%H Rémy Sigrist, <a href="/A307834/b307834.txt">Table of n, a(n) for n = 0..10200</a> (-50 <= x <= 50 and -50 <= y <= 50)

%H Peter Kagey and Rémy Sigrist, <a href="/A307834/a307834_2.png">Colored representation of z(2*k)/abs(z(2*k))*a(2*k) for k = 1..501000</a> (where z(n) = A174344(n) + i*A274923(n) and the hue is function of k)

%H Peter Kagey and Rémy Sigrist, <a href="/A307834/a307834_3.png">Colored representation of z(2*k-1)/abs(z(2*k-1))*a(2*k-1) for k = 1..501000</a> (where z(n) = A174344(n) + i*A274923(n) and the hue is function of k)

%H Rémy Sigrist, <a href="/A307834/a307834.png">Colored illustration of the sequence (with cells (x,y) such that -500 <= x <= 500 and -500 <= y <= 500)</a>

%H Rémy Sigrist, <a href="/A307834/a307834_1.png">Colored illustration of the sequence in function of the parities of x and y</a>

%H Rémy Sigrist, <a href="/A307834/a307834.gp.txt">PARI program for A307834</a>

%e The spiral begins:

%e 8--158---69--111---91---95---93--110---61--147----6

%e | |

%e 164 5---96---46---67---66---62---44---86----5 140

%e | | | |

%e 67 100 4---48---32---31---31---43----4 80 64

%e | | | | | |

%e 123 50 52 3---18---17---15----2 38 45 96

%e | | | | | | | |

%e 97 71 37 20 2----2----1 13 28 51 88

%e | | | | | | | | | |

%e 102 72 39 19 5 0----0 12 26 56 82

%e | | | | | | | | |

%e 99 76 34 25 1----8---10----1 35 42 94

%e | | | | | | |

%e 123 56 58 2---27---22---21---32----2 76 55

%e | | | | |

%e 71 106 6---63---40---46---49---39---70----5 130

%e | | |

%e 172 9--110---54---80---76---75---84---56--122----7

%e |

%e 10--182---73--133--109--117--120--112--141---76--193

%o (PARI) See Links section.

%Y See A307838 for the multiplicative variant.

%Y Cf A174344, A274923.

%K nonn,look

%O 0,4

%A _Rémy Sigrist_, May 01 2019