-->

Looking at long integer sequences for patterns can be very difficult.  The following presents a method of constructing graphs of integer sequences in a way that makes it easy to graphically examine very large digit sequences.  The method also has some novel applications in computer graphics.

An integer is an abstraction.  To realize an abstract integer as a digit sequence a number base must be chosen.  The choice of a base determines the length of a digit sequence used to represent the given integer.  That is, a realized integer has two magnitudes associated with it.  The first is the conventional magnitude we are all familiar with.  The second magnitude is the length of the realized digit string.  We can use these two magnitudes as the coordinates of a point in an arbitrary space.

In the following, we define each digit of a number to represent a single unit vector with a direction defined by the magnitude of the digit.  

Define the direction of the vector via the following map:

int dx[] = { -1, 0, 1, 0 }
int dy[] = { 0, -1, 0, 1 }

To set a pixel in our coordinate space for a single digit then is:

moveTo( 0, 0 );    // set the origin
int digit = i & 3;    // get the direction of our unit vector
setPixel(  dx[ digit ], dy[ digit ], color );    // plot the delta position


Then if we take an integer as the sum of n-vectors, we can plot each pixel:

moveTo( 0, 0);
while( i ) {    // i is some given integer
    int digit = i & 3;    // use base 4
    i = i >> 2;
    setPixel(  dx[ digit ], dy[ digit ], color );    // plot the delta position
}

Clearly, this is fast.  More complex patterns can be displayed by enclosing the above in a loop:

moveTo( 0, 0);
for( int i = 0 ; i < nIterations ; i++ ) {
    int  n = i * i;        // this can be any reasonable function that generates a numerical pattern and pattern of digits
     while( n ) {
         int digit = n & 3;     // use base 4
         n =n >> 2;     
         setPixel(  dx[ digit ], dy[ digit ], color );    // plot the delta position 
     }
}

The following section uses the above loop as the basis for the graphics displayed via the buttons below.  The code was implemented via ActiveX technology for its speed and adaptability to html applications.

down load the desktop app If you have problems viewing the above graphics you can download and install the desktop application. Also, you may want to save this page to your local hard drive as well. After you install the application this page should work fine. Use the parameters above to get a feel for what the application can do. And you may also have a look at the slide show to see how I've used it to make textures for various graphical applications. Recently in a game called Second Life