Finding the law of sequence 1,3,6,10,15.……………… In the same plane, when two straight lines intersect, there is a point, when three lines intersect, there are three corners, when four lines intersect, there are six How many intersections can n (n is greater than 1) lines have at most

Finding the law of sequence 1,3,6,10,15.……………… In the same plane, when two straight lines intersect, there is a point, when three lines intersect, there are three corners, when four lines intersect, there are six How many intersections can n (n is greater than 1) lines have at most

This is a recursive algorithm
Let {an} be the sequence
a1=1 a2=3 a3=6 a4=10 a5=10
The recurrence formula of guessable sequence is: an = n + a (n-1), that is, an-a (n-1) = n
Then: a2-a1 = 2
a3-a2=3
a4-a3=4
.
.
.
a(n-1)-a(n-2)=n-1
an-a(n-1)=n
All the equations are added left and right respectively: an-a1 = 2 + 3 +... + n
There are: an = 1 + 2 + 3 +... + (n-1) + n = n (n + 1) / 2
That is, the nth term of the sequence is n (n + 1) / 2