login
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.
0
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,5
EXAMPLE
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.
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 *)
CROSSREFS
Sequence in context: A018222 A349578 A374260 * A241149 A324992 A093203
KEYWORD
nonn
AUTHOR
Luca Petrone, Jun 14 2018
STATUS
approved