The length of substrings are n or n-1 or n-2 or....or 2 or 1 or 0
let the string is abcd...xyz
no.of substrings of length 'n' = 1 ------ abcd....xyz
no.of substrings of length 'n-1' = 2 ------ abcd....xy , bcd....xyz
no.of substrings of length 'n-2' = 3 ------ abcd....x , bcd....xy , cdef.....xyz
.......
no.of substrings of length '2' = n-1 ----- ab,bc,cd,....vx,xy,yz
no.of substrings of length '1' = n ------ a,b,c,d,....x,y,z
no.of substrings of length '0' = 1 ----> only empty string is possible
total substrings = 1+2+3+...+(n-1) + n + 1
= [ 1+2+3+...+(n-1) + n ] + 1
= $\frac{n(n+1)}{2}$ + 1
= ∑n + 1
NOTE :-
Trivial substrings :- empty string ( which is length = 0 ) and the original string ( which is length = n ) are trivial strings.
∴ No.of Trivial substrings are 2 for any non-empty string
Non- Trivial substrings :- which are not Trivial substrings are called as Non- Trivial substrings.
∴ No.of Non-Trivial substrings are ∑n - 1
Proper Substrings :- the substring which length is less than actual string
∴ No.of Non-Trivial substrings are ∑n
Non-empty Substrings :- the substring which length is grater than 0
∴ No.of Non-Empty substrings are ∑n