Contribution (talk | contribs)
Xenwolf (talk | contribs)
m When I suggested to switch to JavaScript: fixed block formatting (the code tag is for inline formatting, pre is for blocks)
Line 34: Line 34:


Below is a piece of Python code doing it (better solutions may be possible):
Below is a piece of Python code doing it (better solutions may be possible):
<code>
<pre>
primes=[2,3,5,7,11,13,17,19,23,29,31]
primes=[2,3,5,7,11,13,17,19,23,29,31]
   
 
# reciprocal of a given monzo
# reciprocal of a given monzo
def reciprocal(monzo):
def reciprocal(monzo):
    for p in range(0,len(monzo)):
  for p in range(0,len(monzo)):
        monzo[p]*=-1
      monzo[p]*=-1
    return(monzo)
  return(monzo)
   
 
# ABSCISSA MONZOS LIST
# ABSCISSA MONZOS LIST
x_axis=[]
x_axis=[]
for a in range(0,26+1):
for a in range(0,26+1):
    # pythagorean interval  
  # pythagorean interval  
    monzo=[0]*len(primes)
  monzo=[0]*len(primes)
    monzo[1]+=a
  monzo[1]+=a
   
 
    # insert it at the end of the list   
  # insert it at the end of the list   
    x_axis.append(monzo)
  x_axis.append(monzo)
   
 
    # insert its reciprocal at the beginning of the list, so that 1/1 is the center of symmetry between reciprocals
  # insert its reciprocal at the beginning of the list, so that 1/1 is the center of symmetry between reciprocals
    x_axis.insert(0,reciprocal(monzo.copy()))
  x_axis.insert(0,reciprocal(monzo.copy()))
   
 
# ORDINATE MONZOS LIST
# ORDINATE MONZOS LIST
y_axis=[]
y_axis=[]
   
 
# insert 1/1
# insert 1/1
monzo=[0]*len(primes)
monzo=[0]*len(primes)
y_axis.insert(0,monzo)
y_axis.insert(0,monzo)
   
 
# first prime
# first prime
for a in range(2,len(primes)):   
for a in range(2,len(primes)):   
    # pure harmonic series
  # pure harmonic series
    monzo=[0]*len(primes)
  monzo=[0]*len(primes)
    monzo[a]+=1
  monzo[a]+=1
   
 
    # insert the pure harmonic at the beginning of the list
  # insert the pure harmonic at the beginning of the list
    y_axis.insert(0,monzo)  
  y_axis.insert(0,monzo)  
   
 
    # insert its subharmonic version at the end of the list, so that 1/1 is the center of symmetry between reciprocals
  # insert its subharmonic version at the end of the list, so that 1/1 is the center of symmetry between reciprocals
    y_axis.append(reciprocal(monzo.copy()))     
  y_axis.append(reciprocal(monzo.copy()))     
   
 
    # second prime   
  # second prime   
    for b in range(2,a+1):
  for b in range(2,a+1):
       
     
        # combine the pure harmonic with another prime, both by putting it in the numerator or in the denominator
      # combine the pure harmonic with another prime, both by putting it in the numerator or in the denominator
        for c in range(1,-1-1,-2):
      for c in range(1,-1-1,-2):
            monzo=[0]*len(primes)
          monzo=[0]*len(primes)
            monzo[a]+=1
          monzo[a]+=1
           
         
            # when c=1, the second prime is put in the numerator ; when c=-1, the second prime is put in the denominator
          # when c=1, the second prime is put in the numerator ; when c=-1, the second prime is put in the denominator
            monzo[b]+=c
          monzo[b]+=c
           
         
            # before inserting, eliminate the cases where the first and the second prime are reciprocal
          # before inserting, eliminate the cases where the first and the second prime are reciprocal
            if(monzo!=[0]*len(primes)):
          if(monzo!=[0]*len(primes)):
               
             
                # insert the combination at the beginning  
              # insert the combination at the beginning  
                y_axis.insert(0,monzo)
              y_axis.insert(0,monzo)
               
             
                # insert its reciprocal at the end, so that 1/1 is the center of symmetry between reciprocals
              # insert its reciprocal at the end, so that 1/1 is the center of symmetry between reciprocals
                y_axis.append(reciprocal(monzo.copy()))
              y_axis.append(reciprocal(monzo.copy()))
               
             
                # insert 125/64 exception and its reciprocal
              # insert 125/64 exception and its reciprocal
                if(monzo==[0,0,2,0,0,0,0,0,0,0,0]):
              if(monzo==[0,0,2,0,0,0,0,0,0,0,0]):
                    monzo[2]+=1
                  monzo[2]+=1
                    y_axis.insert(0,monzo)
                  y_axis.insert(0,monzo)
                    y_axis.append(reciprocal(monzo.copy()))
                  y_axis.append(reciprocal(monzo.copy()))
 
# CARTESIAN COORDINATE PLANE OF MONZOS
# CARTESIAN COORDINATE PLANE OF MONZOS
table=[]
table=[]
for y in range(0,len(y_axis)):
for y in range(0,len(y_axis)):
    row=[]
  row=[]
    for x in range(0,len(x_axis)):
  for x in range(0,len(x_axis)):
        monzo=[]
      monzo=[]
        for a in range(0,len(primes)):
      for a in range(0,len(primes)):
            # combine the abscissa monzo and the ordinate monzo
          # combine the abscissa monzo and the ordinate monzo
            monzo.append(x_axis[x][a]+y_axis[y][a])
          monzo.append(x_axis[x][a]+y_axis[y][a])
        row.append(monzo)
      row.append(monzo)
    table.append(row)
  table.append(row)
 
##### SHOW RESULT #####
##### SHOW RESULT #####
print(table)</code>
print(table)
</pre>


Would be curious to see your implementation :)
Would be curious to see your implementation :)