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

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. *)

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

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

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

Original entry on oeis.org

1, 2, 4, 5, 9, 12, 16, 22, 26, 33, 38, 45, 53, 60, 61, 76, 86, 91, 92, 97, 111, 112, 121, 134, 135, 147, 148, 150, 153, 157, 167, 180, 200, 212, 223, 227, 228, 238, 246, 264, 269, 282, 286, 305, 312, 313, 321, 322, 327, 328, 360, 374, 389, 393, 395, 420, 421
Offset: 1

Author

Tanya Khovanova, Jan 22 2014

Keywords

Comments

An increasing version of A236335.

Examples

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

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, ok;
          if n<3 then n
        else for k from 1+a(n-1) do ok:=true;
               for j from n-1 to 2 by -1 while ok do
                 for i from j-1 to 1 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
          fi
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Jan 23 2014
  • Mathematica
    g[1] = 1;
    g[n_] := g[n] =
      Min[Complement[Range[g[n - 1] + 1, 500],
        Select[Flatten[
          Table[g[k] + (n - k) (g[j] - g[k])/(j - k), {k, n - 2}, {j,
            k + 1, n - 1}]], IntegerQ[#] &]]]
    Table[g[k], {k, 50}]

A286091 Lexicographically earliest sequence of positive integers such that the slope between any two points (i, a(i)) and (j, a(j)) is distinct.

Original entry on oeis.org

1, 1, 2, 5, 11, 4, 3, 18, 26, 35, 48, 15, 76, 64, 97, 135, 29, 6, 175, 98, 212, 240, 260, 73, 22, 316, 41, 232, 7, 165, 424, 472, 399, 519, 214, 353, 606, 27, 660, 100, 787, 845, 924, 963, 376, 156, 1095, 766, 356, 621, 1206, 32, 501, 1292, 1409, 1169, 1464
Offset: 1

Author

Peter Kagey, May 01 2017

Keywords

Comments

a(1) = a(2) = 1 appears twice; it is the only term that can appear more than once.
From Peter Kagey, May 02 2017: (Start)
Sequence is bounded above by (n-1)*A000217(n-2)+1.
Proof: The first n terms of the sequences have (1+2+...+(n-1)) = A000217(n-2) slopes, thus all of the lines starting at any of the first (n - 1) points with any of the already-present slopes can at most cross (n, 1), (n, 2), ... (n, (n-1)*A000217(n-2)). (End)

Examples

			a(3) != 1 otherwise the slope(a(1),a(2)) = slope(a(1),a(3)), therefore
a(3) = 2.
a(4) != 1 otherwise the slope(a(1),a(2)) = slope(a(1),a(4)),
a(4) != 2 otherwise the slope(a(1),a(2)) = slope(a(3),a(4)),
a(4) != 3 otherwise the slope(a(2),a(3)) = slope(a(3),a(4)),
a(4) != 4 otherwise the slope(a(2),a(3)) = slope(a(1),a(4)), therefore
a(4) = 5.
		

Crossrefs

Cf. A236335.

Programs

  • Maple
    A[1]:= 1:
    Slopes:= {}:
    for n from 2 to 100 do
      for k from 1 do
        Sk:= {seq((k-A[i])/(n-i),i=1..n-1)};
        if Sk intersect Slopes = {} then
          A[n]:= k; Slopes:= Slopes union Sk; break
        fi
    od od:
    seq(A[n],n=1..100); # Robert Israel, May 01 2017
  • PARI
    \\ See link "PARI program". David A. Corneth, May 05 2017

A363554 a(1) = 1; for n > 1, a(n) is the smallest positive integer such that both the gradients and y-intercepts of the lines between any two points (i, a(i)) and (j, a(j)) are distinct.

Original entry on oeis.org

1, 1, 2, 5, 11, 4, 3, 18, 26, 35, 48, 66, 16, 99, 129, 27, 67, 149, 190, 8, 235, 259, 285, 348, 276, 34, 24, 97, 362, 170, 155, 15, 504, 464, 9, 639, 449, 173, 391, 768, 577, 682, 836, 937, 598, 438, 94, 6, 1063, 1007, 500, 210, 1146, 1303, 1390, 806, 1530, 62, 1096, 1739, 212, 28, 1001, 1380
Offset: 1

Author

Scott R. Shannon, Jun 10 2023

Keywords

Comments

This is a variation of A286091 where the y-intercepts of all lines are also distinct.

Examples

			a(12) = 66. A value of 15, with coordinate (12,15), for this term would create a point for which all line gradients are distinct, see A286091, but it creates a line that passes through the origin with a(4), a point with coordinate (4,5). However the terms a(3), at coordinate (3,2) and a(6), at coordinate (6,4), have already created a line that passes through the origin, thus a(12) cannot be 15. The coordinate (12,66) is the first point the leads to all lines and y-intercepts being distinct.
		

Crossrefs

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

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