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

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

A174085 Number of permutations of length n with no consecutive triples i,...i+r,...i+2r for all positive and negative r, and for all equal spacings d.

Original entry on oeis.org

1, 1, 2, 4, 18, 72, 396, 2328, 17050, 131764, 1199368, 11379524, 123012492, 1386127700, 17450444866, 227152227940
Offset: 0

Author

Isaac Lambert, Apr 20 2010

Keywords

Comments

Here we count both the sequence 1,2,3 (r=1) as a progression in 1,2,3,0,4,5, (note d=1) and in 1,0,2,4,3,5 (here, d=2).
Number of permutations of 1..n with no 2-dimensional arithmetic progression of length 3: that is, no three points (i,p(i)), (j,p(j)) and (k,p(k)) such that j-i = k-j and p(j)-p(i) = p(k)-p(j). - David Bevan, Jun 16 2021

Examples

			a(3) = 4; 123 and 321 each contain a 3-term arithmetic progression.
Since the only possibilities for progressions for n=4 are d=1 and r=1 and -1, we get the same term as A095816(4).
		

Crossrefs

Cf. A179040 (number of permutations of 1..n with no three elements collinear).
Cf. A003407 for another interpretation of avoiding 3-term APs.

Formula

a(n) >= A003407(n) with equality only for n in {0, 1, 2, 3}.

Extensions

a(0)-a(3) and a(10)-a(13) from David Bevan, Jun 16 2021
a(14)-a(15) from Bert Dobbelaere, May 18 2025

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);
Showing 1-4 of 4 results.