OFFSET
0,3
COMMENTS
By "in general position" we mean that no two lines are parallel or coincident, and no three are concurrent.
LINKS
EXAMPLE
Line #0 is y = 0*x + 0, as no constraint other than the default one (lexicographically earliest) applies yet, so a(0)=0;
Line #1 cannot be y = 0*x + 1, as the reuse of the slope of a previously defined line implies parallelism; but it can be y = 1*x + 1, so a(1)=1;
Line #2 cannot be y = 2*x + 2, as lines #0, #1 and #2 would be concurrent at (-1,0); but Line #2 can be y = 3*x + 2, so a(2)=3; ...
PROG
(PARI)
g(n, an, p)=my(b=1); for(i=1, #p, if(p[i][2]==an*p[i][1]+n, b=0; break)); b
c(n, s, p)=my(an=0); while((setsearch(s, an, 0)!=0)||!g(n, an, p), an++); an
w(n, a, an, p)=for(m=0, #a-1, my(am=a[1+m]); listput(p, [(m-n)/(an-am), (am*n-an*m)/(am-an)])); p
list_a(N)=my(a=List(), s=List(), p=List(), n=0, an); while(n<=N, an=c(n, s, p); p=w(n, a, an, p); listput(a, an); listinsert(s, an, setsearch(s, an, 1)); n++); Vec(a)
list_a(75)
CROSSREFS
KEYWORD
nonn
AUTHOR
Luc Rousseau, Sep 22 2023
STATUS
approved