Permuted multiples: Difference between revisions

(Added Go)
Line 136:
see "working..." + nl
see "Permuted multiples are:" + nl
per = list(6)
perm2 = []
perm = list(6)
perm3 = []
perm4 = []
perm5 = []
perm6 = []
 
for n = 1 to 1000000
perm2for x = []2 to 6
perm3 perm[x] = []
perm4 = []
perm5 = []
perm6 = []
per2 = 2*n
perStr2 = string(per2)
for m = 1 to len(perStr2)
add(perm2,perStr2[m])
next
per3perStr = 3*nlist(6)
perStr3for z = string(per3)2 to 6
for m = 1 toper[z] = len(perStr3)n*z
addperStr[z] = string(perm3,perStr3per[mz])
for m = 1 to len(perStr2perStr[z])
add(perm2perm[z],perStr2perStr[z][m])
next
next
per4for y = 4*n2 to 6
perStr4 perm[y] = stringsort(per4perm[y])
for m = 1 toperStr[y] = lenlist2str(perStr4perm[y])
addperStr[y] = substr(perm4,perStr4perStr[my],nl,"")
next
per5 = 5*n
perStr5 = string(per5)
for m = 1 to len(perStr5)
add(perm5,perStr5[m])
next
per6 = 6*n
perStr6 = string(per6)
for m = 1 to len(perStr6)
add(perm6,perStr6[m])
next
perm2 = sort(perm2)
perm3 = sort(perm3)
perm4 = sort(perm4)
perm5 = sort(perm5)
perm6 = sort(perm6)
perStr2 = list2str(perm2)
perStr3 = list2str(perm3)
perStr4 = list2str(perm4)
perStr5 = list2str(perm5)
perStr6 = list2str(perm6)
perStr2 = substr(perStr2,nl,"")
perStr3 = substr(perStr3,nl,"")
perStr4 = substr(perStr4,nl,"")
perStr5 = substr(perStr5,nl,"")
perStr6 = substr(perStr6,nl,"")
if perStr2perStr[2] = perStr3perStr[3] and perStr2perStr[2] = perStr4perStr[4] and perStr2perStr[2] = perStr5perStr[5] and perStr2perStr[2] = perStr6perStr[6]
see "n = " + n + nl
see "2*n = " + (n*2) + nl
2,468

edits