cantorOrdering.frink

Download or view cantorOrdering.frink in plain text format


// This draws a graph of numbers which are relatively prime to each other.

g = new graphics
g.antialiased[false]
g.fillRectCenter[1,-1,1,1]
g.font["Monospaced",1/2]

max = 361
for i=0 to max
   for j=1 to i-1
   {
      if gcd[i,j] == 1
      {
         g.fillRectCenter[i,-j,1,1]
         g.fillRectCenter[j,-i,1,1]
      }
   }

for n = 1 to max
{
   g.text[n, 0, -n]
   g.text[n, n, 0]
}

g.show[]
//g.print[]
   
   


Download or view cantorOrdering.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20145 days, 12 hours, 6 minutes ago.