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-6 of 6 results.

A236335 Lexicographically earliest sequence of positive integers whose graph has no three collinear points.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 9, 3, 3, 6, 8, 5, 6, 9, 17, 4, 8, 15, 13, 24, 17, 13, 26, 32, 14, 7, 12, 29, 12, 18, 10, 10, 23, 35, 7, 16, 14, 30, 24, 23, 30, 46, 27, 20, 52, 15, 25, 40, 29, 40, 19, 38, 58, 18, 39, 42, 16, 69, 33, 25, 67, 43, 11, 51, 28, 11, 54, 73, 26, 27
Offset: 1

Views

Author

Tanya Khovanova, Jan 22 2014

Keywords

Comments

An integer can't appear more than twice in the sequence, which means the sequence tends to infinity.
An increasing version of this sequence is A236336.

Examples

			Consider a(5). The previous terms are 1,1,2,2. The value of a(5) can't be 1 because points (1,1),(2,1),(5,1) (corresponding to values a(1), a(2), a(5)) are on the same line: y=1. Points (3,2),(4,2),(5,2) are on the same line y=2, so a(5) can't be 2. Points (1,1),(3,2),(5,3) are on the same line: y=x/2+1/2, so a(5) can't be 3. Points (2,1),(3,2),(5,4) are on the same line: y=x-1, so a(5) can't be 4. Thus a(5)=5.
		

Crossrefs

Programs

  • Mathematica
    b[1] = 1;
    b[n_] := b[n] =
      Min[Complement[Range[100],
        Select[Flatten[
          Table[b[k] + (n - k) (b[j] - b[k])/(j - k), {k, n - 2}, {j,
            k + 1, n - 1}]], IntegerQ[#] &]]]
    Table[b[k], {k, 70}]

Formula

a(n) = A236266(n-1) + 1. - Alois P. Heinz, Jan 23 2014

A231334 Lexicographically earliest sequence of distinct positive integers such that for any distinct i,j, k, the points at positions (i, a(i)), (j, a(j)), (k, a(k)) are not aligned.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 9, 12, 7, 14, 13, 8, 23, 17, 18, 22, 10, 15, 11, 28, 19, 16, 20, 29, 32, 44, 35, 39, 24, 40, 26, 37, 42, 21, 56, 64, 43, 31, 25, 34, 27, 33, 66, 67, 52, 60, 30, 57, 36, 63, 86, 82, 38, 50, 47, 69, 75, 79, 89, 49, 45, 76, 41, 48, 98, 77, 94
Offset: 1

Views

Author

Paul Tek, Nov 07 2013

Keywords

Comments

Is this a permutation of the natural numbers?
There are only two fixed points: 1 and 2.

Crossrefs

Programs

  • C
    See Link section.
  • Mathematica
    WIDTH = 1000;
    HEIGHT = 2000;
    Clear[seen, aligned, a];
    compute[n_] := Module[{c = 1}, While[seen[c] || aligned[n][c], c++; If[c > HEIGHT, Abort[]]]; a[n] = c; seen[a[n]] = True; For[i = 1, i < n, i++, dn = n - i; da = a[n] - a[i]; g = GCD[dn, da]; dn /= g; da /= g; nn = n; na = c; While[True, nn += dn; If[nn > WIDTH, Break[]]; na += da; If[na < 1 || na > HEIGHT, Break[]]; aligned[nn][na] = True]]; a[n]];
    Array[compute, WIDTH] (* Jean-François Alcover, Apr 19 2020, translated from Paul Tek's program. *)

A255708 No three points (i,a(i)), (j,a(j)), (k,a(k)) are collinear, for n = 0,1,2,... the value of a(n) is chosen to be m or -m (in this order) for the smallest m>=0 satisfying the condition.

Original entry on oeis.org

0, 0, 1, 1, -1, -1, 4, 2, 2, -3, -5, -2, -7, -2, 5, 3, 3, -5, -4, -4, 6, 5, -6, -3, -10, 11, -6, 4, 18, 11, 19, 7, 12, 12, 6, -13, 19, 7, -10, -7, -9, -14, 13, 23, -28, -8, -14, 9, 8, -22, -9, -8, 23, -11, 15, 22, 13, 8, -21, -13, -26, 9, -12, -12, -11, 40, 21
Offset: 0

Views

Author

Alois P. Heinz, Mar 03 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, t, ok;
          for t from 0 do for k in [t, -t] do ok:=true;
            for j from n-1 to 1 by -1 while ok do
              for i from j-1 to 0 by -1 while ok do
                ok:= (n-j)*(a(j)-a(i))<>(j-i)*(k-a(j))
            od od; if ok then return k fi
          od od
        end:
    seq(a(n), n=0..60);

A255709 No three points (i,a(i)), (j,a(j)), (k,a(k)) are collinear and all values distinct, for n = 0,1,2,... the value of a(n) is chosen to be m or -m (in this order) for the smallest m>=0 satisfying the condition.

Original entry on oeis.org

0, 1, -1, 2, 3, -2, -5, -3, 4, -6, 6, -7, -4, 5, 12, 16, 7, 8, -10, -8, 9, 19, 14, -12, -14, -9, 21, 10, -11, -15, 17, 15, -19, 13, -22, -13, -16, -24, 11, 18, 22, -18, 25, 23, -17, 24, 40, -21, -38, 20, -29, 36, -30, -20, 32, -34, 26, 43, -23, 37, -26, 33
Offset: 0

Views

Author

Alois P. Heinz, Mar 03 2015

Keywords

Crossrefs

Programs

  • Maple
    b:= proc() true end:
    a:= proc(n) option remember; local i, j, k, t, ok;
          for t from 0 do for k in [t, -t] do ok:=b(k);
            for j from n-1 to 1 by -1 while ok do
              for i from j-1 to 0 by -1 while ok do
                ok:= (n-j)*(a(j)-a(i))<>(j-i)*(k-a(j))
            od od; if ok then b(k):=false; return k fi
          od od
        end:
    seq(a(n), n=0..60);

A333825 Lexicographically earliest sequence of distinct positive integers, which when mapped onto a square spiral, gives a set without three distinct aligned points.

Original entry on oeis.org

1, 2, 3, 4, 17, 20, 22, 27, 45, 48, 67, 79, 80, 131, 135, 174, 180, 194, 201, 209, 236, 254, 312, 319, 394, 523, 644, 656, 706, 711, 733, 765, 766, 845, 848, 921, 922, 935, 1034, 1051, 1219, 1292, 1310, 1330, 1399, 1410, 1546, 1589, 1674, 1792, 1816, 1863
Offset: 1

Views

Author

Rémy Sigrist, Apr 07 2020

Keywords

Comments

This sequence has similarities with A236266.

Examples

			The first terms, mapped onto a square spiral, are:
         *---*---*---*---*---*---*---*---*
         |                               |
         *   *---*---*---*---*---*---*   *
         |   |                       |   |
        67   *  17---*---*---*---*   *   *
         |   |   |               |   |   |
         *   *   *   *---4---3   *   *   *
         |   |   |   |       |   |   |   |
         *   *   *   *   1---2   *   *   *
         |   |   |   |           |   |   |
         *   *  20   *---*---*---*  27   *
         |   |   |                   |   |
         *   *   *--22---*---*---*---*   *
         |   |                           |
         *   *---*--45---*---*--48---*---*
         |
         *---*---*---*---*---*--79--80---*
		

Crossrefs

See A333835 and A333866 for a similar sequences.

A305921 Lexicographically earliest sequence of nonnegative integers such that no three points (i,a(i)), (j,a(j)), (n,a(n)) are collinear and no four points (i,a(i)), (j,a(j)), (k,a(k)), (n,a(n)) are on a circle.

Original entry on oeis.org

0, 0, 1, 1, 5, 3, 8, 2, 3, 2, 4, 8, 9, 7, 15, 11, 4, 10, 5, 11, 16, 9, 30, 38, 26, 30, 18, 10, 28, 36, 17, 21, 38, 7, 12, 20, 49, 41, 23, 23, 6, 16, 28, 13, 6, 29, 49, 56, 17, 19, 36, 22, 24, 56, 64, 12, 61, 21, 14, 69, 13, 68, 78, 53, 33, 69, 39, 27, 31, 18
Offset: 1

Views

Author

Luca Petrone, Jun 14 2018

Keywords

Examples

			The sequence starts like A236266, but a(5) cannot be 4, because (1,0), (2,0), (4,1) and (5,4) lie on the same circle.
		

Crossrefs

Programs

  • Mathematica
    a[0] = a[1] = 0; a[2] = 1; a[n_] := a[n] = Module[{i, j, k, l, AB, AC, CD, BC, BD, AD, ok, ok1}, For[l = 0, True, l++, ok = True; For[j = n - 1, ok && j >= 1, j--, For[i = j - 1, ok && i >= 0, i--, ok = (n - j)*(a[j] - a[i]) != (j - i)*(l - a[j])]]; If[ok, For[k = n - 1, ok && k >= 1, k--, For[j = k - 1, ok && j >= 0, j--, For[i = j - 1, ok && i >= 0, i--, AB = ((a[i] - a[j])^2 + (i - j)^2)^0.5; AC = ((a[i] - a[k])^2 + (i - k)^2)^0.5; CD = ((a[k] - l)^2 + (k - n)^2)^0.5; BC = ((a[k] - a[j])^2 + (k - j)^2)^0.5; BD = ((a[j] - l)^2 + (j - n)^2)^0.5; AD = ((a[i] - l)^2 + (i - n)^2)^0.5; ok = AB*CD + BC*AD != AC*BD;];];]; If[ok, Return[l]]]]] (* Luca Petrone Jun 17 2018, based on A236266 program by Jean-François Alcover *)
Showing 1-6 of 6 results.