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.
%I A382951 #39 Apr 16 2025 07:26:59 %S A382951 1,2,3,5,4,7,11,9,13,17,19,23,8,29,31,27,25,37,39,16,41,43,14,47,33, %T A382951 53,35,59,61,67,71,73,49,79,83,89,97,101,103,55,107,109,91,113,85,127, %U A382951 131,137,139,121,149,151,157,133,163,65,167,51,125,173,143,179,181,191,161,22,193,169,197,199,211 %N A382951 Sequence of positive integers with no repetitions and, when put in a spiral, all lines (straight or diagonal) are pairwise coprime. %C A382951 We take the lexicographically earliest sequence that fits the name. %C A382951 It seems likely (but unproven) that every positive integers appear and that this sequence is a permutation of the positive integers. Some number just takes very long to appear. For instance, here are the number of steps it took to reach some numbers: %C A382951 6: 160 steps %C A382951 10: 468 steps %C A382951 12: 571 steps %C A382951 15: 4048 steps!! %C A382951 18: 582 steps %C A382951 20: 1492 steps %C A382951 21: 820 steps %C A382951 It takes at least floor(N/2)^2 steps before the first N integers appear. Any tighter bound? %e A382951 4 -- 5 -- 3 %e A382951 | | %e A382951 7 1 -- 2 %e A382951 | %e A382951 11 -- %e A382951 . %e A382951 Look at the 7th term. It couldn't be 1, 2, 3, 4, 5, and 7 as they already occurred in the sequence. It also can't be 6, 8, or 10 because they all share factors with 4 which is in the vertical line (...4, 7, 11...). It cannot be a 9 because of the diagonal (...11, 1, 3...). %t A382951 S[n_]:=Block[{v,sq={1}, p=Most[{Re@#, Im@#}&/@ Fold[Join[#1, Last[#1]+I^#2 Range[#2/2]]&, {0}, Range[4n+2]]], A=<||>, T=<||>, s, d=Rest@ Tuples[{0,1,-1}, 2]}, T[1]=1; A[{0,0}]=1; s[z_]:=Block[{L={},o}, Do[o=z; While[ Max[Abs[o+e]]<=n, AppendTo[L,o+=e]],{e,d}];L]; Do[v=LCM@@ A/@ Intersection[Keys[A], s[u]]; k=2; While[ KeyExistsQ[T,k] || GCD[v,k]>1,k++]; AppendTo[sq,k]; T[k]=1; A[u]=k, {u, Rest@p}]; (* Print@ Graphics@ Table[ Text[sq[[i]], p[[i]]], {i,Length[p]}]; *) sq]; S[4] (* S[n] returns the values for a grid of semidiameter n. Uncomment the Print to show the spiral. _Giovanni Resta_, Apr 10 2025 *) %Y A382951 Cf. A336349. %K A382951 nonn %O A382951 1,2 %A A382951 _Bryle Morga_, Apr 09 2025