Euler’s phi function 2,8,48, 480, 5760

It doesn’t take too much delving around with the primes to come across the appearance of Euler’s totient or phi function. It oozes out of the primes in a variety of locations.

Firstly the composite helices and thus the prime helices each have a “width”. The width of the 6n+/-1 helix associated with prime factor 5 is 2. The width of the next helix associated with prime factor 7 is 8. The next is 48 and the conjecture is that this continues:




Secondly, considering the balance of primes to composites as each prime factor is used to calculate which are composite and which are potentially prime we see a simple pattern:

Each block is pi# integers long,

Each block has (pi   – 1) # (potential) primes &  (pi-1 -1)# composites

Thus the ratio of

primes to all integers:    (pi   – 1) # /  pi#

primes to composites       (pi   – 1) # / (pi-1 -1) # = pi   – 1


Posted in Prime Number Distribution | Leave a comment

Let’s start at the beginning…..

In summary, the story so far:

  1. The prime “pattern” expressed by prime numbers is in fact a composite of one to many individual patterns of composites.
  2. The prime “pattern” is of a stepped nature so it starts simple (2,3….how more simple do you want it?) and gets more complex with each step. The steps are at Pi2.
  3. Each “pattern” of composites that contribute to the overall “pattern” are of length Pi#.
  4. Each “pattern” of composites does not come into effect at Pi2. Each starts at Pi2  + a variable multiple of Pi.
  5. There is a drawbridge effect so that the overall pattern “progresses” and the distribution of the smaller primes are too simple to be included in the pattern for larger primes.
Posted in Prime Number Distribution | Leave a comment

What’s the problem?

We want to define the prime numbers as a logical sequence with a workable formula for the nth term and a means of establishing what n is when we have a given integer. As such we should then be able to distinguish prime numbers from composites.

Barriers to doing this:

i) whilst the general trend of the primes becoming less frequent with increasing n is well known the frequency does not decrease uniformly; the terms appear to pulse with both gaps and areas of higher frequency.

ii) the well known twin primes (but no triplets (see Counting the Twins)

iii) the well known gaps – with evidence of increasing gaps with increasing n

Primes have been described as random, unruly, baffling reflecting the frustration of the observer; there has also been commentary on harmony, music and other references to spirals, waves and the like. Just what is going on? Explainable or inexplicable?

In addition there are several well known observations about the primes:

Almost all rules/observations require an exception e.g.

  1. all primes are odd, except 2. So even the simplest description has an exception!
  2. all primes are separate, except 2 & 3.

Which leads onto a more general problem:

  1. rules for smaller primes may not apply to all (i.e. larger) primes
  2. rules that appear to apply require exceptions of smaller primes

As you will read in this blog once one understands the nature of the prime number problem and the inherent complexity, things become clearer, at least conceptually. Understanding that structure gives me some confidence to predict that there will never be a practical prime formula and since I can say why. However, there does seem to be a way of counting primes – but not every prime – and thus making some sense of things.

The startling thing is that the analysis is relatively simple…….


Posted in Prime Number Distribution | Leave a comment

Milestones in the primes – calculating the n in pn

So, in the two previous blogs on composite and secondary arrays I have shown how we can lay out prime numbers in an infinite series of arrays, with gaps filled by specific composites made up of pn x pn and greater but not involving an composites having a smaller denominator.

These arrays appear to be a little disappointing if we are only interested in prime numbers.

If I could only get a table into a jpg file format I would post it here! Inserting a table seems impossible to keep the format in wordpress! In the mean time it doesn’t take much to leap from the infinite series of arrays provided to be able to show where specific numbered primes will i.e. in the table below

13th prime is 41

48th prime is 223

345th prime is 2327……except that 2327 is not prime: 2333 is the 345th prime so you will need to see the table to see what it provides

3,250 etc….









Meanwhile the series 13, 48, 345, 3250, 42333 is not registered on OEIS so maybe no one has got here yet?


Meanwhile I have found out that Microsoft Excel starts to be of little use if you need more than around 15 significant digits so this is as far as I can go:

The 9,414,916,809,097th prime number is the first prime number after 304,250,263,527,257.

I can make a stab at both the

362,597,750,396,746th prime number

and the 1,539,772,852,781,310th prime number

but excel being excel and I have also reached the limit of




Image | Posted on by | 2 Comments

Secondary arrays

This element needs to be read after that titled “Composite arrays“.

A secondary array of integers (a mix of primes and composites) emerges by dividing the associated composite array by Pn  i.e. by the prime number “associated” with that composite array. Remember, the array is still in place but this time, whilst there are still composites in the array, a remarkable thing happens – all the prime numbers Pn and greater emerge. On contemplation, a mix of primes and composites may not seem very enlightening. However, it appears that the composites are “disappearing” faster than the primes.

Let’s look at the secondary array associated with prime number 5:

The composite array consists of


55  85   115   145

65  95   125  155

The resulting secondary array consists of two rows with a gap of 6 between the columns

11   17    23   29

13   19   25   31

This is recognizable by the well known 6n+1 and 6n-1 algorithm that contains all primes. It appears to be less well known that there is an infinite number of such arrays (one for each prime) arising from this process.

Let’s look at the secondary array that arises from prime number 7. The composite array is shown under the composite array blog so if we divide each term by 7 we are left with

11   41   71   101   131   161   191   221

13   43   73   103   133   163   193   223

17   47   77   107   137   167   197   227

19   49   79   109   139   169   199   229

23   53   83   113   143   173   203   233

29   59   89   119   149   179   209   239

31   61   91   121   151   181   211   241

37   67   97   127   157   187   217   247

So, we still have eight rows but now the columns/terms are separated by 210/7 i.e. 30. The first column contains only prime numbers but composites creep in at greater frequencies as you move left to right (not surprisingly). However, the composites are not just any old composites – they are an increasingly select bunch  that fill the gaps between primes, which, remember, are in an array – those naughty old primes, often accused of being “random” are in a set matrix at regular intervals. And remember, there is an infinite set of arrays, one for each prime number!

So, let’s do the same as before to see the “line of symmetry: move two lines from bottom to top and offset:

___31   61   91   121   151   181   211   241

___37   67   97   127   157   187   217   247

11   41   71   101   131   161   191   221

13   43   73   103   133   163   193   223

——-line of symmetry at pn-1# i.e. 15——

17   47   77   107   137   167   197   227

19   49   79   109   139   169   199   229

23   53   83   113   143   173   203   233

29   59   89   119   149   179   209   239

Having divided the composite array by 7 the lines are now separated from the line of symmetry by





So an infinite series of arrays with a mix of primes and composites – mysterious perhaps, but not very exciting. Hold one….let’s see what come next: “Milestones in the primes – calculating the n in pn




Posted in Prime Number Distribution | Leave a comment

Start here…..Composite arrays or more strictly helices

Starting an analysis of prime numbers from the composites is something that some number theory books start and then dismiss once the complexities are considered in detail: however in theory, on the basis that composites are relatively straight forward they can be counted and their number subtracted from the total integer count to yield the number of primes. Easy!

A practical difficulty kicks in quickly – well two difficulties actually:

  1. It’s not as simple as counting each multiple of 2,3,5,7,11 etc..separately (i.e. each prime number or factor) as all composites (other than squares) are the result of multiplying two different primes so can be expressed more than once; thus 6 = 2 x 3 =3 x 2 and so could be counted as a multiple of 2 and a multiple of 3. As another example 60 = 2 x 2 x 3 x 5 could be counted as a multiple of 2, 3 and 5. An adjustment is required.
  2. The first factor leads to a second related difficulty in that no composites need to be counted against any prime factor Pi  where c < Pi2   . Thus for prime factor 5 the first composite not already accounted for by prime factors 2 and 3 is 25. The next is 35. Smaller composites such as 10, 15, 20 and 30 are also multiples of 2 or 3 or both.
  3. Once the second factor is taken into consideration we don’t need to worry about adjusting any count for primes themselves.

So let’s make an adjustment for these two difficulties, assuming we start with the smallest prime factor 2 and work upwards:

The number of composites from 2 starts with 4 and continues with every larger even number: as a series these can be expressed as 2n+2 (i.e. where n=1 the term is 4) or counting from the integers as a whole n = I/2 – 1 or (I-2)/2


I=4  n=1

I=6  n=2

Thus is we wish to count the number of composites of 2 less than an integer I, we can use I/2 – 1.

We can then count the number of composites from prime factor 3. These start with 9 and continue with every odd multiple of three (the even ones were all accounted for as multiples of 2. The formula 6n+3 applies (i.e. where n=1 the term is 9).

To count the multiples based on integer I we use the formula (I-3)/6.

Combining the count for prime factors 2 and 3 gives a formula of 2(I-3)/3 where the formula produces a whole integer.

Can we continue with this approach? Trouble is, we cannot (easily) as the composites for prime factor 5 (and larger factors) are not uniformly distributed 25,35, 55,65 etc. For easy formulas we need to consider two separate formulas; for prime factors 7 and above we need multiple formulas….the number of which amazingly relate to Euler (see elsewhere).

At this point we need to take a closer examination of the unique composites associated with each prime factor. In the paragraph above the start of the sequence associated with prime factor are listed. As will be seen they occur in pairs and are 30 apart; as will be seen elsewhere these define the well known 6n+1/-1 formula (divide them by 5 if you cannot wait, but one of the tricks is to work out where exactly the series starts).

Things start to get a little “clearer” (maybe complex is a better word initially, but clearer can be used in retrospect) when we look at the unique composites associated with prime factor 7.

With no surprise they start at 49 but then continue in what at first appears a little random.

49,  77,  91, 119, 133, 161, 203, 217, 287, 301, 329, 343, 371, 413, 427

It’s only when you arrange them that you start to see a bit of structure


77,  91, 119, 133, 161, 203, 217, 259

287, 301, 329, 343, 371, 413, 427, 469

putting 49 to one side you can see that the positions of the composites are in rows of 8 with a repeat at intervals of 210. You can keep going for as long as you want; after all the pattern is a result of an interaction of the four prime factors – 2, 3, 5 and 7 – nothing else so this is pretty simple.

If you are interested in the Online Sequence of Integers this sequence is labelled A063163 and defined as “Composite numbers which in base 7 contain their largest proper factor as a substring”.

We can do this analysis for each subsequent prime factor.

We find that for every prime number pi  there is an associated array of composite numbers that consist of the composites derived from pi  and larger prime factors but does not include any composites with a prime factor of por less.

Each sequence of composites are well defined and can be considered to be arranged in a helix but the start of each subsequent helix is off-set by one prime factor.

The first two “helices” (for prime factors 2 and 3) are trivial in that they each consist of a single line of integers (4,6,8,10 etc and 9,15,21,27 etc). Only with that for prime factor 5 does the helix start to show us some of its features with two lines of integers, but it takes examination of the fourth and fifth before a fuller picture emerges…..and if you have got this far and wondered what this is going to tell you about prime number distribution, just be patient!

There are three dimensions I can give for each of these composite helices:

  1. there are  (Pi-1 – 1)# elements in each turn of the helix
  2. the strands of the helix are pi # apart
  3. each helix has a line of symmetry at p#/2

So here is a starting table (sorry for the limitations of posting a table in wordpress):

pi        No of elements in 1st column  Gap between columns   Line of symmetry

3                1                                                6
5                2                                               30                                         15
7                8                                               210                                       105
11              48                                             2310                                     1155
13             480                                           30030                                  15015
______(Pi-1 – 1)#                                   p#                                          p#/2

OEIS      A005867                                A002110                                A070826

For those who have explored the prime numbers the above framework may appear familiar. However, arrays of composite numbers, by themselves tell us very little about the primes. You have to move onto the secondary arrays to get an inkling on what is going on…..see “Secondary arrays“.

But before moving on we need to examine the composite integers that sit on the above arrays or frameworks. As above it is useful to refer to the Online Encylopedia of Integer Sequences (OEIS) rather than listing long lists of integers: however, there are a number of differences with regards to starting points. I haven’t been too careful on this front so I expect some quality control might be useful.

So, for the composite integers that “sit” on the above frameworks:

OEIS sequence A083140 contains a pretty good summary of the early sequences,  but of course the arrays are not acknowledged. The following OEIS sequences make up A083140 but in this context you have to leave off both the first prime number and the second term of the prime squared:

2 4 6 8 10 12 14 16 18 20 22 24 .... (A005843)

3 9 15 21 27 33 39 45 51 57 63 69 .... (A016945)

5 25 35 55 65 85 95 115 125 145 155 175 .... (A084967)

7 49 77 91 119 133 161 203 217 259 287 301 .... (A084968)

11 121 143 187 209 253 319 341 407 451 473 517 .... (A084969)

13 169 221 247 299 377 403 481 533 559 611 689 .... (A084970)


Thus the repetitive array for prime number 7 starts with 77 and the second column of the array starts with 77 + 210 = 287. Thus the composite array as a whole reads:

77   287   497   707   917   1127   1337   1547

91   301   511   721   931   1141   1351   1561

119   329   539   749   959   1169   1379   1589

133   343   553   763   973   1183   1393   1603

161   371   581   791   1001   1211   1421   1631

203   413   623   833   1043   1253   1463   1673

217   427   637   847   1057   1267   1477   1687

259   469   679   889   1099   1309   1519   1729


As you can see there are 8 rows of integers, and each item in each row is spaced at 210; however, the “line of symmetry” at 105 is not in the middle. One has to rearrange the array to “see” it – two lines need to be brought to the top of the array and offset:



____217   427   637   847   1057   1267   1477   1687

____259   469   679   889   1099   1309   1519   1729

77   287   497   707   917   1127   1337   1547

91   301   511   721   931   1141   1351   1561

————–line of symmetry————————

119   329   539   749   959   1169   1379   1589

133   343   553   763   973   1183   1393   1603

161   371   581   791   1001   1211   1421   1631

203   413   623   833   1043   1253   1463   1673


(Offsetting or steps is something one gets used to with primes, but we’re not on the primes yet!)


So now if one measures the distance of each of the eight rows from a line starting with p#/2 you will see the rows are spaced at equal distances from the mid-line:

-98 (the distance between 217 and 315)

-56 (the distance between 259 and 315)



+14 (=2 x 7)

+28 (= 4 x 7)

+56 (=8 x 7)

+98 (= 14 x 7)


So, an array of equal spaced composite numbers is not too exciting is it? Just keep following – it gets much more interesting: see “Secondary arrays













Posted in Counting the Composites | Leave a comment

Counting the prime pairs

Is there an infinite number of prime pairs?

How frequent are prime pairs?

Why are their prime pairs?

Intriguing questions best examined from the composites: why do they exist for starters? Look at the role of prime factors 2 and 3. They lead to the first prime pair 5&7.

Look at the role of prime factors 2, 3 and 5. 41/43 and 59/61 show up, but 37/39 and 53/55 would be pairs without the effects of 13 and 11.

We can show the number of pairs per length of composite numbers thus:

It starts:

PF 2,3: 1 pair for each 5 composites (20% or 40% of composites are one of a pair)

PF 2,3,5: 4 pairs for 30 composites (13.3% or 26.6% of composites are one of a pair)

PF 2,3,5,7: 19 pairs in 210 composites (9.0% or 18.1% of composites are one of a pair)

and so on. Can we establish a formula and work out whether it has an asymmtote?




Posted in Prime Number Distribution | Tagged | Leave a comment