1. Introduction
In many chemical structures, we notice the existence of data from the hexagonal systems, which consists of hexagonal rings connected to each other, and that any two rings in this system are either shared by an edge or not shared.
By matching each hexagonal ring with a vertex, and connecting any two of the resulting vertices with an edge when the two rings have an edge in common, the resulting statement is called the characteristic graph of the hexagonal system.
A hexagonal system is said to be Catacondensed if there are no three hexagonal rings sharing one vertex.
Types of Catacondensed unbranched hexagonal systems contain data such that each characteristic statement is equivalent to a trail statement ([6], [2], [8-9]).
A non-branched Catacondensed hexagonal ring system is said to be a multi-circles of paraffin structural, which is sometimes called a hexagonal ring band graph if every edge common to any two rings is the same as all edges common to any two rings of the same system, as shown in Figure -1-
We will code this type of compound with 𝑯𝟐𝒑, since 2p represents the number of carbon atoms corresponding to the rank of the statement, and p is always an odd number.
In the statement related to G, the number of pairs of vertices of G that are on the dimension K of each other is denoted by the symbol d(G,k) where 𝑘= 0,1,2, . . . , δ
The wiener polynomial [3] of G is defined as:
The Wiener index is defined by the statement G: is the sum of the distances between all pairs of vertices in G, that is:
The sum is taken on each of two different vertices u or v in G.
The Wiener proof based on the Wiener polynomial can be expressed as the derivative of the Wiener polynomial for x, when x=1, that is:

Where 𝑾′(𝑮; 𝒙)represents the derivative of the Wiener polynomial.
If the number of vertices in the connected statement G is p, then there are
2 𝑝(𝑝−1) unordered pairs of different vertices in the statement. We can now define the average distance [1] of G as the product of dividing the Wiener proof of G by 1/2 p (p-1), and the average distance of G is denoted by 𝑫̅(𝑮), that is:
We must mention that the Scientist H.Wiener [3] was the first to study the total distance in the data he observed in the structures of chemical molecules, as his results and contributions were well known to specialized chemists, but mathematicians ' knowledge of them was limited. And that the usefulness of the Wiener polynomial is to obtain the total distance, which represents the Wiener index, which has wide uses in Chemistry [1].
2. The Main Theorem
The Wiener polynomial of a paraffin polynomial-rings 𝑯𝟐𝒑 of rank 2p is:

Where:
Thus:
And that the diameter is p, and δ=p.
Proof:
Suppose that the headers of the statement 𝑯𝟐𝒑 are tagged with the formula.
We will denote the distance between any two vertices in 𝑉𝑖 at a distance k from each other by 𝒅(𝑯𝟐𝒑, 𝒌)𝑉𝑖,since i=1,2, and denote the distance between a vertex of 𝑉1 with a vertex of 𝑉2 at a distance k from each by 𝒅(𝑯𝟐𝒑, 𝒌)𝑉1𝑉2.
We note that:
For each k = 0,1,2,…, p
Where 𝑷𝒑 is a trail of rank p.
Where:

Now, we follow the method of mathematical induction to prove the relationship (1) at k=2, then:
Where:

When k=3, then:
Where:


When k=4, then:
Where:


We assume that Formula (1) is true when k=r, thus:
Now we will prove that Formula (1) is true when k=r+1
thus:

3. The result
Wiener's proof of the paraffin polytope-the 𝑯𝟐𝒑 rings of rank 2p are:

And that the average distance of this compound is not more than
Proof:


The above formula can be written in the following form:

And that the average distance:
And after simplifying the amount, we get:

We note that the magnitude
𝟑, whatever the value of p. (Since p is always greater than or equal to 3 in these compounds). Then:

Where the magnitude
𝟑(𝒑+ 𝟑)represents the upper bound of the average distance for 𝑯𝟐𝒑 and does not represent the upper limit constraint.
For example, if the value of p is 7, then:
Finally, we designed a program in the MATLAB language to calculate the coefficients of the Wiener polynomials as a sequence of numbers starting with the coefficient for powers of zero and ending with the coefficient for powers of p, as well as giving Wiener's proof and the average distance once a p value is entered.
To verify the accuracy of the program, we entered p=7 and the results were matched, starting from the coefficients for the Wiener polynomial, the Wiener proof and the distance parameter.
4. The Main Algorithm
1. Start.
2. Enter the value of p (which represents the number of carbon atoms).
3. Create the adjacency matrix A (by dividing the matrix A into four partial matrices and defining these matrices and then performing some operations on them), It is known that matrix A is a symmetric matrix.
4. Definition of a zero-initial Matrix B and a zero-initial Matrix s.
5. Put k=1.
6. Put s(k)=0.
7. Calculation of the matrix C, C=A^k.
8. Put i=1
9. Put j=i+1.
10. If 𝐴(𝑖, 𝑗) ≠0and B (i, j) = 0, then:
B(i, j) = k s(k) = s(k)+1
11. Put j=j+1.
12. If j<=2*p go to step 10 otherwise make i=i+1.
13. If i<=2*p-1 Go to step 9 otherwise make k=k+1.
14. If k<=p go to step 6.
15. We print Wiener polynomial coefficients [2*p s(1) s(2) s(3) … s(p)] (Starting from the coefficient for forces zero to the coefficient for forces p).
16. We print the Wiener index guide 𝑖𝑛𝑑𝑒𝑥= ∑ 𝑘𝑠(𝑘) 𝑝 𝑘=1
17. We print the average distance average = index / p(2*p-1)
18. The end.
5. The program
% Program to evaluate Coefficients of Wiener Polynomial, Wiener index and Average distance for multi-circles of paraffin structural G of order 2*p.(p is positive odd integer number).
p=input(' input p = ');
a=ones(1,p-1);
b=diag(a,1)+diag(a,-1);
c=eye(p,p);
for i=2:2:p-1 c(:,i)=0;
% A is adjacency matrix of the graph.
A=[b c;c b];
B=zeros(2*p,2*p);
s=zeros(1,p);
for k=1:p s(k)=0;
C=A^k;
for i=1:2*p-1 for j=i+1:2*p if (C(i,j)~=0)&(B(i,j)==0)
B(i,j)=k;
s(k)=s(k)+1;
%coefficient stands for the Wiener polynomial coefficients. coefficients=[2*p,s]
% [2*p,s]is given matrix with size (1,p+1) such that the first element is
% 2*p, and other elements are matrix elements s.
% Wiener index of G is given by index.
index=sum(polyder(fliplr(coefficients)))
% average distance of G is given by average.
average=index/(p*(2*p-1)) input p = 7 coefficients =
14 16 22 21 14 10 6 2 index = average =
3.0659