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-7 of 7 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

A236266 Lexicographically earliest sequence of nonnegative integers such that no three points (i,a(i)), (j,a(j)), (n,a(n)) are collinear.

Original entry on oeis.org

0, 0, 1, 1, 4, 3, 8, 2, 2, 5, 7, 4, 5, 8, 16, 3, 7, 14, 12, 23, 16, 12, 25, 31, 13, 6, 11, 28, 11, 17, 9, 9, 22, 34, 6, 15, 13, 29, 23, 22, 29, 45, 26, 19, 51, 14, 24, 39, 28, 39, 18, 37, 57, 17, 38, 41, 15, 68, 32, 24, 66, 42, 10, 50, 27, 10, 53, 72, 25, 26
Offset: 0

Views

Author

Alois P. Heinz, Jan 21 2014

Keywords

Comments

(a(n)-a(j))/(n-j) <> (a(j)-a(i))/(j-i) for all 0<=i

Examples

			For n=4 the value of a(n) cannot be less than 4 because otherwise we would have a set of three collinear points, {(0,0),(1,0),(4,0)} or {(2,1),(3,1),(4,1)} or {(0,0),(2,1),(4,2)} or {(1,0),(2,1),(4,3)}.  Thus a(4) = 4 is the first value that is in accordance with the constraints.
		

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, ok;
          for k from 0 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
        end:
    seq(a(n), n=0..60);
  • Mathematica
    a[0] = a[1] = 0; a[n_] := a[n] = Module[{i, j, k, ok}, For[k = 0, True, k++, 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)*(k-a[j])]]; If[ok, Return[k]]]];
    Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Jun 16 2018, after Alois P. Heinz *)

Formula

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

A300002 Lexicographically earliest sequence of positive integers such that no k+2 points fall on any polynomial of degree k.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 9, 16, 14, 20, 7, 15, 8, 12, 18, 31, 26, 27, 40, 30, 49, 38, 19, 10, 23, 53, 11, 32, 21, 25, 13, 47, 83
Offset: 1

Author

Peter Kagey, Apr 17 2017

Keywords

Comments

a(n) must avoid 2^(n-1)-1 polynomials: the polynomials defined by each nonempty subset of the first (n-1) terms of the sequence.
Conjecture: This sequence is a permutation of the natural numbers.
From David A. Corneth, May 10 2017: (Start)
Sequence is also "Lexicographically earliest sequence of positive integers such that any k+1 points fall on a polynomial of degree k."
Conjecture: a(27)-a(32) are 11, 32, 21, 25, 13, 47. If all previous data are correct, no polynomial of degree ceiling(n/2.5) - 1 goes through any set of points. (End)
Formerly A285175. - Peter Kagey, Mar 06 2018

Examples

			a(1) = 1.
a(2) != 1 or else (1, 1) and (2, 1) fall on y = 1. (Similarly all terms must be distinct.)
a(2) = 2.
a(3) != 1 or else (1, 1) and (3, 1) fall on y = 1.
a(3) != 2 or else (2, 2) and (3, 2) fall on y = 2.
a(3) != 3 or else (1, 1), (2, 2) and (3, 3) fall on y = x.
a(3) = 4.
a(4) != 1 or else (1, 1) and (4, 1) fall on y = 1.
a(4) != 2 or else (2, 2) and (4, 2) fall on y = 2.
a(4) = 3
		

Crossrefs

Programs

  • Mathematica
    A = {{1, 1}, {2, 2}};
    n = 3;
    While[n < 50,
    c = Sort[Select[Select[InterpolatingPolynomial[#, n] & /@ Subsets[A, {1, n - 1}], # > 0 & ] , IntegerQ]];
    B = Differences[c];
    If[Max[B] == 1,
    d = Max[c] + 1,
    d = Part[c, First[Position[B, Select[B, # > 1 &][[1]]]][[1]]] + 1];
    A = Append[A, {n, d}];
    Print[{n, d}]
    n++;
    ] (* Luca Petrone, Apr 18 2017 *)

Extensions

a(21)-a(26) from Luca Petrone, Apr 19 2017
a(27) from Robert G. Wilson v, Jul 09 2017
a(28)-a(33) from Bert Dobbelaere, Apr 12 2024

A334043 a(1) = 0, and for any n > 1, a(n) is the number of points of the set { (k, a(k)), k = 1..n-2 } that are visible from the point (n-1, a(n-1)).

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 5, 4, 5, 7, 8, 8, 10, 8, 9, 12, 11, 13, 16, 14, 15, 16, 14, 17, 20, 20, 17, 21, 25, 23, 26, 28, 27, 25, 29, 25, 31, 27, 34, 34, 28, 39, 35, 36, 41, 36, 40, 41, 41, 42, 45, 35, 49, 45, 47, 46, 49, 47, 49, 47, 54, 54, 52, 56, 54, 54, 58, 56, 59
Offset: 1

Author

Rémy Sigrist, Apr 13 2020

Keywords

Comments

For any i and k such that i < k: the point (i, a(i)) is visible from the point (k, a(k)) if there are no j such that i < j < k and the three points (i, a(i)), (j, a(j)), (k, a(k)) are aligned.

Examples

			For n = 5:
- we consider the following points:
        .   .   .   X
                  /  (4,2)
        .   .   X   .
              /  (3,1)
        X   X   .   .
   (1,0)     (2,0)
- (1,0) and (3,1) are visible from (4,2)
- whereas (2,0) is not visible from (4,2),
- hence a(5) = 2.
		

Crossrefs

See A334044 for a similar sequence.
Cf. A231334.

Programs

  • PARI
    g(z) = z/gcd(real(z), imag(z))
    for (n=1, #a=vector(69), print1 (a[n] = #Set(apply(k -> g((k+a[k]*I)-(n-1+a[n-1]*I)), [1..n-2])) ", "))

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

Author

Alois P. Heinz, Mar 03 2015

Keywords

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

Author

Alois P. Heinz, Mar 03 2015

Keywords

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);

A300670 Table read by antidiagonals: the n-th row is the lexicographically earliest sequence such that no k + 2 points of ((1, a(1)), (2, a(2)), ...) lie on a polynomial of degree k for k < n.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 4, 2, 1, 5, 3, 4, 2, 1, 6, 6, 3, 4, 2, 1, 7, 5, 6, 3, 4, 2, 1, 8, 9, 5, 6, 3, 4, 2, 1, 9, 12, 9, 5, 6, 3, 4, 2, 1, 10, 7, 12, 9, 5, 6, 3, 4, 2, 1, 11, 14, 19, 12, 9, 5, 6, 3, 4, 2, 1, 12, 13, 17, 19, 16, 9, 5, 6, 3, 4, 2, 1, 13, 8, 7, 17
Offset: 1

Author

Peter Kagey, Mar 11 2018

Keywords

Comments

Is every row a permutation of the natural numbers?
The first row is the positive integers, the second row is A231334, and the main diagonal is A300002.
T(n, m) = A300002(m) for n >= m, thus the rows converge to A300002 in the limit.

Examples

			Table begins
1, 2, 3, 4, 5, 6, 7,  8,  9, 10, 11, 12, 13, 14, 15, 16, ...
1, 2, 4, 3, 6, 5, 9, 12,  7, 14, 13,  8, 23, 17, 18, 22, ...
1, 2, 4, 3, 6, 5, 9, 12, 19, 17,  7,  8, 15, 20, 18, 22, ...
1, 2, 4, 3, 6, 5, 9, 12, 19, 17,  8, 10, 31,  7, 11, 22, ...
1, 2, 4, 3, 6, 5, 9, 16, 14, 20,  7, 15,  8, 12, 18, 31, ...
1, 2, 4, 3, 6, 5, 9, 16, 14, 20,  7, 15,  8, 12, 18, 31, ...
...
In the first row, no two points lie on a 0-degree polynomial (i.e., all terms are distinct).
In the second row, no two terms are the same and no three points (1, a(1)), (2, a(2)), ... lie on the same line.
In the third row, no two terms are the same; no three points (1, a(1)), (2, a(2)), ... lie on the same line; and no four points lie on the same parabola.
		

Crossrefs

Showing 1-7 of 7 results.