I want to write the following code in sagemath but unable to write it:
Suppose we consider the group Zn.
We consider an element a∈Zn and form the subgroup generated by a i.e. ⟨a⟩=a,2a,3a,…0.
We form a graph G whose vertices are ⟨a⟩ and ⟨a⟩ and ⟨b⟩ are adjacent if either ⟨a⟩⊂⟨b⟩ or ⟨b⟩⊂⟨a⟩ .
How to plot the graph G is Sagemath?
I am giving an example to clear the question:
Consider Z4 then consider ⟨0⟩, ⟨1⟩ , ⟨2⟩, ⟨3⟩
Clearly ⟨0⟩=0, ⟨1⟩=1,2,3,0 , ⟨2=2,0⟩, ⟨3=0,1,2,3⟩.
Thus the graph G has vertices as ⟨0⟩, ⟨1⟩ , ⟨2⟩, ⟨3⟩ and ⟨0⟩ is adjacent to ⟨1⟩ , ⟨2⟩, ⟨3⟩,
⟨1⟩ is adjacent to ⟨2⟩ , ⟨0⟩,
⟨2⟩ is adjacent to ⟨1⟩ , ⟨0⟩, ⟨3⟩
and ⟨3⟩ is adjacent to ⟨0⟩, ⟨2⟩
Thus G becomes