#Please do not post homework #Ravali Bommanaboina, 11/1/20, Assignment 15 #Question 1 RoG:=proc(k,n) local V,E,i,j,T1,v,Neighs,Moves,m,pt: for i from 1 to nops(V) do T1[V[i]]:=i: od: E:=[]: for i from 1 to nops(V) do pt:=V[i]: Moves:={[1,0],[-1,0],[0,1],[0,-1]}: Neighs:={seq(pt+m,m in Moves)}: Neighs:=Neighs intersect convert(V,set): E:=[op(E),{seq(T1[v],v in Neighs)}]: od: E,V: end: #Question 2 #NuW([40, 40], {[0, 1], [1, 0], [1, 1], [2, 2]}); ->2382564832244243056285491057263 #2293242735541148110927807195990 is the number of walks that does not go over x=y #Question 2 # 7, 115, 2371, 54091, 1307377 #A081798 #2,10,88,1043 is not in OEIS