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.

A364311 Lexicographically earliest infinite sequence of nonnegative integers, {a(n)} for n>=0, such that all lines with equations y = a(n)*x + n are in general position.

Original entry on oeis.org

0, 1, 3, 2, 5, 4, 8, 11, 6, 13, 12, 7, 22, 16, 17, 21, 9, 14, 10, 27, 18, 15, 19, 28, 31, 43, 34, 38, 23, 39, 25, 36, 41, 20, 55, 63, 42, 30, 24, 33, 26, 32, 65, 66, 51, 59, 29, 56, 35, 62, 85, 81, 37, 49, 46, 68, 74, 78, 88, 48, 44, 75, 40, 47, 97, 76, 93, 79, 92, 54, 58, 100, 61, 101, 107, 52
Offset: 0

Views

Author

Luc Rousseau, Sep 22 2023

Keywords

Comments

By "in general position" we mean that no two lines are parallel or coincident, and no three are concurrent.

Examples

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

Crossrefs

Cf. A000217 (number of intersection points to avoid after line #n is created).

Programs

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