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.

Showing 1-3 of 3 results.

A336350 Square spiral of distinct nonnegative integers constructed by greedy algorithm, such that two terms on the same row or on the same column have no common one bit in their binary representations.

Original entry on oeis.org

0, 1, 2, 4, 8, 6, 16, 3, 12, 32, 24, 64, 5, 48, 72, 128, 256, 17, 96, 512, 10, 33, 144, 320, 1024, 516, 192, 1280, 2048, 4096, 9, 130, 1536, 288, 2112, 4100, 8192, 514, 160, 6144, 16384, 32768, 13, 1152, 768, 10240, 20480, 65536, 18, 32800, 12288, 2304, 640
Offset: 0

Views

Author

Rémy Sigrist, Jul 19 2020

Keywords

Comments

We can always extend the sequence with a power of 2 greater than any previous term, so the sequence is well defined.
For symmetry reasons, we obtain the same sequence when considering a clockwise or a counterclockwise square spiral, or when initially moving towards any unit direction.

Examples

			The spiral begins:
         264------80--262144---81920----5120---32896----2560----8224-------7
           |                                                               |
       49152    8192----4100----2112-----288----1536-----130-------9   65552
           |       |                                               |       |
        3072     514     256-----128------72------48-------5    4096  131072
           |       |       |                               |       |       |
        4608     160      17       8-------4-------2      64    2048   17408
           |       |       |       |               |       |       |       |
       73728    6144      96       6       0-------1      24    1280     640
           |       |       |       |                       |       |       |
      393216   16384     512      16-------3------12------32     192    2304
           |       |       |                                       |       |
      524288   32768      10------33-----144-----320----1024-----516   12288
           |       |                                                       |
     1048576      13----1152-----768---10240---20480---65536------18---32800
           |
          19---65792---18432----9216---33280--655360--266240-2097152-1048584
		

Crossrefs

See A336349 for a similar sequence.

Programs

  • PARI
    See Links section.

A366303 Square array A(n, k), n, k > 0, read and filled by upwards antidiagonals the greedy way with distinct positive integers such that any two distinct terms in the same row or column are coprime.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 9, 8, 11, 13, 17, 19, 21, 15, 23, 29, 25, 31, 37, 41, 35, 43, 47, 53, 14, 59, 61, 67, 49, 71, 65, 73, 55, 79, 83, 89, 97, 101, 103, 107, 6, 109, 113, 127, 121, 131, 137, 139, 149, 119, 143, 151, 157, 163, 167, 169, 173, 179, 181, 191, 12, 133, 193, 197, 199, 211
Offset: 1

Views

Author

Rémy Sigrist, Oct 06 2023

Keywords

Comments

This sequence is a variant of A366030, with one less constraint.
All the prime numbers appear in the sequence, in ascending order.
For any prime number p, the first multiple of p in the sequence is p.
Will every positive integer appear in the sequence?

Examples

			Array A(n, k) begins:
  n\k |   1    2    3    4    5    6    7    8    9   10
  ----+-------------------------------------------------
    1 |   1    3    4   13   23   35   67   89  121  167
    2 |   2    7   11   15   41   61   83  127  163  199
    3 |   5    8   21   37   59   79  113  157  197  247
    4 |   9   19   31   14   55  109  151  193  221  307
    5 |  17   25   53   73    6  143  133  241  293  353
    6 |  29   47   65  107  119   12  239  283  349  401
    7 |  43   71  103  149  191  233   10   33  161  463
    8 |  49  101  139  181  229  281   27   16   95  451
    9 |  97  137  179  227  277  323  341   91   18  115
   10 | 131  173  223  253  347  397  461   85  613   24
		

Crossrefs

Programs

  • PARI
    See Links section.

A382951 Sequence of positive integers with no repetitions and, when put in a spiral, all lines (straight or diagonal) are pairwise coprime.

Original entry on oeis.org

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, 53, 35, 59, 61, 67, 71, 73, 49, 79, 83, 89, 97, 101, 103, 55, 107, 109, 91, 113, 85, 127, 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
Offset: 1

Views

Author

Bryle Morga, Apr 09 2025

Keywords

Comments

We take the lexicographically earliest sequence that fits the name.
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:
6: 160 steps
10: 468 steps
12: 571 steps
15: 4048 steps!!
18: 582 steps
20: 1492 steps
21: 820 steps
It takes at least floor(N/2)^2 steps before the first N integers appear. Any tighter bound?

Examples

			    4 -- 5 -- 3
    |         |
    7    1 -- 2
    |
   11 --
.
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...).
		

Crossrefs

Cf. A336349.

Programs

  • Mathematica
    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 *)
Showing 1-3 of 3 results.