OFFSET
1,2
COMMENTS
An increasing version of A236335.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
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}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Jan 22 2014
STATUS
approved