In Pursuit of Trends in Primes


The prime numbers are numbers which are divisible only by itself and 1. This means that all primes have two factors, so for that reason, “1” is not prime.


The first 100000 integers seems to have the greatest density of prime numbers. 9592 primes were found there, meaning on average, nearly one in 10 of the first 100000 integers were prime.

Dissecting this interval further, for the first 1000 contiguous integers there are 168 primes:

  1-100          25        0.25
101-200          21        0.21
201-300          16        0.16
301-400          16        0.16
401-500          17        0.17
501-600          14        0.14
601-700          16        0.16
701-800          14        0.14
801-900          15        0.15
901-1000         14        0.14
TOTAL           168        0.168

we see we’re already in trouble. While the first 200 integers clearly show dominance in having the most primes, with the first 100 integers having the most of all, the remainder fall into some kind of pseudo-random torpor, with some intervals higher, and some lower. 16 primes occur in three of the intervals, and 14 occur in another three.

In this interval, it is difficult to figure out if the numbers are meandering up or down. Let’s look at the second thousand:

1001-1100    16    0.16
1101-1200    12    0.12
1201-1300    15    0.15
1301-1400    11    0.11
1401-1500    17    0.17
1501-1600    12    0.12
1601-1700    15    0.15
1701-1800    12    0.12
1801-1900    12    0.12
1901-2000    13    0.13
TOTAL:      135    0.135

Is this a downward trend? We observe the first 10 thoudsands:

   1-1000    168    0.168
1001-2000    135    0.135
2001-3000    127    0.127
3001-4000    120    0.120
4001-5000    119    0.119
5001-6000    114    0.114
6001-7000    117    0.117
7001-8000    107    0.107
8001-9000    100    0.100
9001-10000   112    0.112
TOTAL:      1219    0.1219

A major jump upward is observed in the last interval, but it does not get to the level of the first 4 intervals. This is noticed nearly universally, and is reproduced here. If you look at the number of primes in regularly-spaced intervals of contiguous sequences of integers with each interval the same size, you tend to see a general declining trend, followed by a seemingly random meanindering of numbers of primes going up and down in number. This observation appears to be independent of
interval size.

In the interval 99001 to 100000, the last 1000 numbers in the interval, we observe that there are 86 primes. Clearly, this is below what we have just observed in the first 10 intervals of 1000, but in the interval 97001-98000, we observe only 82 primes, where we had expected a slightly greater number than 86. The number of primes once again are returning to a similar pseudo-random torpor observed earlier.

I define “pseudo” randomness as frequencies which go on a downward trend in an unpredictably meandering way. True randomness would have frequencies going all over the place.

So, if intervals of size “p” were used, the first p integers would contain the most primes; while there would be a downward trend for integers from p+1 to 2p; 2p+1 to 3p, and so on. By some middle interval kp+1 to (k+1)p, there would occur a relatively low number of primes in some pseudo random torpor. By the time we arrived at interval np+1 to (n+1)p, the frequency of primes become noticeably fewer. I am afraid I am not yet in a position to define the word “noticeably”. You just have to notice it.

But the word “noticeably” might imply that there is an upper limit of frequencies which it does not attain. That is, if “e” was the upper limit of a predicted frequency by interval np+1 to (n+1)p, we need to set the number so as to guarantee to ourselves that it does not rise above the limit. As a first approximation, I am willing to set e, if 2 divides n, as being the same for the interval (n/2)p+1 to ((n/2)+1)p, or the interval half-way to the last one. You obviously can be more restrictive than that, but at least you can see from my numbers that this clearly works out.

Contiguous Intervals of 100000

Taking the whole interval of the first 100000 positive integers contiguously, we find there are 9592 primes, far and away more than any other such interval observed for 100000 integers. The second interval from 100001 to 200000, has 8392 primes. Going from 1 billion, the interval has 4832 primes. While it is not clear if we are returning to torpor, we can see at least that the number of primes are decreasing.

The strongest proof I have observed of a decline returning to a chaos of up-and-down numbers of primes, was to see that these observations were even consistent when I counted 100,000 contiguous integers, and jumping 10^50 integers and counting another interval of 100,000 from there. I kept this up under Maple 9.5 up to 10^2000. The last intervals from 10^1700 took the longest to count (well, _you_ try checking 100000 integers which are each 1700 digits long, and see how long it takes you!). It is still cranking away, and there are 4 intervals left. In all, it will probably take 9 hours on a dual-core processor, so on the optimistic side, I have about 3 hours remaining.

The results so far have been enough to more than indicating a trend:

10^0            9592
10^50            895
10^100           407
10^150           274
10^200           216
10^250           165
10^300           143
10^350           129
10^400           115
10^450            96
10^500            81
10^550            71
10^600            78                   *
10^650            65
10^700            68                   *
10^750            59
10^800            52
10^850            57                   *
10^900            57                   *
10^950            45
10^1000           39
10^1050           38
10^1100           43                   *
10^1150           33
10^1200           38                   *
10^1250           43                   *
10^1300           21
10^1350           32                   *
10^1400           28
10^1450           28                   *
10^1500           26
10^1550           35                   *
10^1600           32
10^1650           28
10^1700           28                   *
10^1750           29                   *
10^1800           27
10^1850           23

As has been stated by other writers, prime numbers appear to have a pattern, but the pattern has eluded us. It seems the pattern of decreasing numbers of primes as integers increase by many orders of magnitude seems to be elusive indeed, appearing pseudo-random, but with a general downward trend. One might desire to regress the numbers of primes per 100,000 integers to a curve, but I am not sure that would tell us anything meaningful by way of a pattern.

Why TSP rocks

I discovered textured soy protein (TSP, or textured vegetable protein [TVP]) in a local bulk foods store, sold in bins. TSP is a protein extract from the soybean. Soybeans is an already versatile plant that is used for many different purposes. It can be used as a meat analog, similar to the way surimi can be used as an analog for shellfish.

Flavoured with the appropriate broth, it can be used as a replacement or as a supplement to chicken, or beef. In the un-flavoured state, it can be used to add a meat-like texture to spaghetti sauces, chili, lasagna, you name it. If you are a vegetarian, you now can take advantage of a plant-based food which, pound for pound, has the same protein value as meat, with a fraction of the calories. You can now serve Hamburger Helper without any actual hamburger.

A recent experiment at Paul King’s Labs (my kitchen) used Hamburger Helper, the leftover remains of a Spanish onion, fried separately in a skillet greased with margarine until it was somewhat brown (grease poured away afterward), a quarter pound of lean ground beef, fried until all brown, and one full cup of TVP, to which nearly a cup of boiling water was added. To the concoction was added the noodles and the Hamburger Helper mix (Lasagna flavour), another cup of  water, and finally a small whole tin of tomato paste (mostly because I just love to kick that tomato flavour up a few notches).

TVP does not need the aid of hot water to hydrate itself; cold water will do. TVP does not necessarily need cooking, but I just want it to be there because I think it needs to absorb the surrounding juices and flavours like the meat does. So, the TVP is added just after the hamburger turns brown. Broth isn’t necessary for something like Hamburger Helper, so that additional preparation isn’t needed.


Algebra Tiles

I once thought algebra tiles were stupid. But these days, I believe that they are essential for young children up to Grade 10 to understand how the factored quadratic is expanded, and to actually “get” the FOIL method when it’s introduced.

It is especially revealing when you understand the root of the word “quadratic” comes from “quadrat”, which is a device used to measure land area. Imagine buying a tract of land (x – 3) meters long by (x + 4) meters wide. Such a property must be rectangular, and I think for consistency sake, so should your algebra tiles. The placement of the tiles should reflect the dimensions of the rectangle. That is, an observer should be able to make out the factors of the quadratic in the finished product.

I actually don't own any algebra tiles, so I just drew a picture conveying the general idea. The square is the square of x; the lines each represent x, to make 8x; where the lines cross each represent one more number added to the constant term. 15 crosses thus make the number 15. This looks like a great idea for teaching how binomials can be multiplied to kids who haven't seen it before. This graphc was scrawled out in MS-Paint.

If you are like me, you probably don’t own these things, but to teach expansion of binomial factors to kids, you can certainly draw squares and lines.

Multiplying a pair of binomials will generate a quadratic upon expansion, of the form Ax^2 + Bx + C.

Along the horizontal, we can suss out a measurement of x + 5 units in length in the first illustration; along the vertical we see a dimension of x + 3 units. Draw the lines so that they continue past the square and extend so that they cross all of the lines going in the other orientation. Counting the number of crosses will give you the constant term (C); counting the total number of lines will give the coefficient before the x term (B); and counting the number of squares give the coefficient of the x^2 term. Knowing that MS Paintbrush does an ugly job when using the same colour, I used a different color for the horizontal lines. These different colors can become handy when the binomial contains a subtraction. For example:

This is an improved graphic, and does illustrate how the black represents subtraction.

This second illustration shows how -2x may be represented by algebra tiles.  We see the middle term go to 3x - 2x = x. But what about the crosses? We need to make up a rule whereby if the crosses are of different signs (that is, different colors), the count is to a negative number (in this case, six crosses make -6). Conversely, if they are of the same sign (both negative or both positive), the count is to a positive number.

My Discovery of Biodegradeable Plastic

Biodegradeable plastic at one time was the kind of plastic that would indeed degrade … after 10,000 years. It wasn’t much cause for fanfare back in the ’90s (although there was much euphoria at the time). Well, I was cleaning my room one day, and now I am among the believers in biodegradeable plastic.

My room which is my home office, is, to be quite honest, a hopeless mess at the best of times. But whever I can see my way clear from my busy schedule, I do indeed put in a bit of effort to clean things up. Ironically, I used to be a lot neater, and still have a few good habits, such as keeping a few extra plastic shopping bags on hand to replace bags of garbage I throw out from my room.

So, one day, I got irritated enough at my own mess to start vacuuming and tossing out my swelling bags of garbage (I have two wastebaskets, usually full to overflowing). I grab one of my spare empty garbage bags, and discover to my horror that the bag I grabbed shattered into a dozen pieces as I grabbed it. And as I attempted to pick up some of the larger pieces of the plastic bag, each piece shattered into easily another dozen pieces each. I grumbled as I turned on the vacuum again to suck up the decayed remains of the shopping bag I was about to use.

So, the good news for the environment is that, yes, biodegradeable shopping bags do in fact exist in a meaningful way, and no, I did not go shopping prior to the last ice age.

Biodegradeable plastics last about 50 days under good aerobic conditions for disposal. I would imagine it would take longer to degrade under anaerobic conditions. Anaerobic conditions are common in landfill sites. Oxybiodegradeable plastic cannot degrade under anaerobic conditions. Hydrobiodegradeable plastic can, releasing methane. Microorganisms are generally responsible for the decay of hydobiodegradeables, but oxybiodegradeables can degrade anywhere, even under water.  I am imagining that my shopping bag was of the oxybiodegradeable kind, since it was empty, and lying around for some months.

More on the distinction.

e to the Pie Eye

Not knowing enough about the math of complex numbers, I find the equation eπi = -1 intriguing. This is apparently the famous Euler’s Identity. I mean, how exactly do they get a real number out of an imaginary one without squaring? I had gotten some insight by playing with my calculator. I have a good one which is able to compute e^{\pi i} without choking on it. It helps that it understands complex math, like many new calculators do these days.

So, I tried something using an idea such as  \lim_{x \to e} x^{\pi i}, where x was allowed to approach Euler’s constant. The way I “approached” e was a tad kludgy, but useful: I began with a “2”, computed the result, then “2.7”, adding the next successive decimal, computed that, and kept the process going for several more decimal places. My results could be tabulated as:

x Result
2 -.5702332490 + 0.8214828311 i
2.7 -.9997752846 + 0.02119859190 i
2.71 -.9999540533 + 0.009585998981 i
2.718 -.9999999469 + 0.0003257333283 i
2.7182 -.9999999955 + 0.00009457240125 i
2.71828 -1.000000000 + 0.000002112790593 i

So, as you can probably suss out, as we add successive digits to the base the base approaches e, the real part of the number becomes -1, while the imaginary part of the number slowly melts away to nothing. By the time we get to 2.718281828 (the value of e seen on most calculator displays), we get the number: -1.000000000 + 0.0000000001202932385 i. Like many things we associate with the understanding of Euler’s constant, it seems the limit (in my case, in the form of playing with my calculator) is one approach to understanding Euler’s identity. There is another, better approach.

Of couse, the next lesson I feel the need to proceed to, is, what the heck is all this about e^{\theta i} = \cos \theta + i \sin \theta?

Something of a record for me

Well, finally running 10 km non-stop is a reality, and it merely felt like the first time I ran 5 km. No strain, no weariness (except between my shoulder blades for some reason), and the worst feeling I had was dehydration. I practically monopolized the water fountain for some time, and minutes later, I still felt thirsty.

Now that I’ve increased my running distances to 5, 7 and 10 km, I am reminded that I have to now worry about re-hydrating over the course of the week.

It is a personal achievement for me, as it is the first time in about 5 or 6 years that I’ve done this.