Decoding the Primes

by Roger L. Bagula 17 Nov. 2001©

Abstract: A hidden Markov model is discussed for the prime numbers that is recursive and of a Goedel code type.

Body: This is my own individual work. I tried to figure out how the binary output of the primes made sense. The primes based on powers of two were the first clue:

1) p(x)=2^p(y)+/-1

I then discovered the odd prime types:

2) p(x)=3^p(y)+/-2

which for general odd prime p(z) works to give many primes:

3) p(x)=p(z)^p(y)+/-2

Finally, noticed that some primes are from even composite numbers like:

4) p(x)=2^p(n)*3^p(m)+/-1

This last led me to the formula:

5) p(x)=p(a)^p(n)*p(b)^p(m)+/-2^l

For the first four primes taken as:

6) startset={p(0)=0,p(1)=1,p(2)=2,p(3)=3}

This formula gives the primes to 29. When the start set is increased to include 5 and 7

the primes into the 50's are produced. The redundancy becomes a problem as well

as larger primes at this level. If the primes produced are put back into the process

recursively, this process generates all the primes. 

This kind of process is called a hidden Markov model. The powers of prime type coding is well known from the work of Kurt Goedel in which he stated that statements could be coded as powers of primes in products. What can be coded can also be decoded so that if given a prime, you can find the numbers that made it. It isn't a code that just gives one answer many, but several for some primes, hence the redundancy problem. I used a sorting and redundancy removal/ elimination in my program. The use of zero as a prime is necessary in the frequency variables as powers. The model is of an (A,B) symbolic dynamics type where different sets of A and B as primes with powers give the primes and some composite numbers that are very like primes that can be sieved out with ease. 

The puzzle of the Cantor set like behavior of the primes that has a very complex 

and changing dimensional structure led me to look at topological entropy. There I found the concept of hidden Markov models and it dawned on me that the powers

formula I had found while sick on a visit to my brother's was just such a recursive

coding of the primes. It took me several days to program up a simple text program, but

it showed that the worst trouble with the model was not calculation, but redundancy and very prime like composites that had to be sieved out. A bubble sort and a zeros redundancy program seem to handle most of the redundancy problem and a simple

logical sieve on array choice gets most of the composites. The mystery of the ages

of the message in the primes is discovered in this model. 

True Basic program:

DIM a(0 to 1050)

LET a(0)=0

LET a(1)=1

LET a(2)=2

LET a(3)=3

LET count =4

PRINT " Hidden Markov output"

PRINT " by Roger L. Bagula 14 Nov 2001 (C)"

PRINT " using (2,3) as base primes (A,B) and 0,1,2,3 as frequency primes"

PRINT " state machine only works if 0 is taken as the 0th prime"

PRINT " The result has redundancy built in"

PRINT " State machine: p(x)=A^p(c)*B^p(d)+/-2^n: n<> 0 if p(c)=0"

FOR i=0 to 4

FOR j=0 to 4

FOR l=-1 to 1 step 2

LET p =a(i)

LET q =a(j)

IF p<>0 then LET n=a(2)^p*a(3)^q+l else LET n=a(3)^q+l*2

REM eliminating factors of 5 and false prime -1

IF (mod(n,3)<>0 or n=3) and(mod(n,5)<>0 or n=5) and (mod(n,11)<>0 or n=11 ) and (mod(n,13)<>0 or n=13 ) and n<>-1 then

LET count=count+1

LET a(count)=n

END IF

NEXT l

NEXT j

NEXT i

PRINT

PRINT" bubble sort of Markov array and redundancy elimination "

FOR j= 0 to count

LET switch =0

FOR i=0 to count-1

LET test=i+1

IF a(test)<a(i) then

LET s=a(i)

LET a(i)=a(test)

LET a(test)=s

LET switch=switch+1

END IF

NEXT i

IF switch =0 then EXIT FOR

NEXT j

REM Redundancy eliminations by zeros

FOR j=0 to count

REM makes a redundancy zero

FOR i=0 to count

IF a(i+1)=a(i) then

LET a(i+1)=0

END IF

NEXT i

REM sorts all zeros to higher counts

FOR i=0 to count

IF a(i)=0 and i<>0 then

LET a(i)=a(i+1)

LET a(i+1)=0

END IF

NEXT i

NEXT j

PRINT a(0);" ";

LET ncount=0

FOR i= 0 to count

IF a(i)<>0 then

PRINT a(i);" ";

LET ncount= ncount+1

END IF

NEXT i

PRINT "new count",ncount

END




Last Modified: by Roger L. Bagula 17 Nov. 2001©