## 27.9.19

### Goldbach Conjecture

According to the Goldbach Conjecture every even integer greater than 2 can be represented as the sum of two prime integers. But, I wondered, how does this conjecture affect odd integers? I also wondered if this conjecture has some application to some of the conjectures I made related to the product of two distinct prime integers greater than 2.

By definition of even and odd integers, if x is an odd integer, then x+1 is an even integer and x-1 is also an even integer.

A few years ago I conjectured that there are 2 non-trivial integers a and b such that a2 = 1 mod n and b2 = 1 mod n where a + b = n whenever n is the product of two distinct prime integers greater than 2. I called a and b "lonely squares". There are also 2 trivial lonely squares, namely 1 and n-1.

Z35 is very special because:
35 = 5*7, which is not an even integer and yet:
292 = 1 mod 35
and 29+7 = 36 = 1 mod 35

Furthermore,
29+5 = 34 mod 35
342 = 1 mod 35

Note: 29 and 6 are the only non-trivial "lonely square" in Z35.

1 is a trivial "lonely square" since 1^2 = 1 for all n where n = p*q where p and q are distinct odd primes.

34 is also a trivial "lonely square" because, as I proved previously, given any n = p*q where p and q are distinct odd primes, then (n-1)^2 = 1 mod n

29 + 34 is clearly not equal to 35, which is okay since 34 is not prime. The interesting part in this case is the fact that there is a direct relation between the odd integer x=35, its surrounding even integers 34 and 36, the prime integers 5 and 7 of which 35 is a product, and the so-called "lonely squares" of Z35

Another finite field with these interesting properties is Z15 because:
15 = 3*5
11^2 = 1 mod 15
11+ 5 = 16 = 1 mod 15

Furthermore,
11+3 = 14
14^2 = 1 mod 15

Note: 11 and 4 are the only non-trivial "lonely squares" in Z15. And 14 is a trivial one.

Unfortunately, this is not applicable to all products of primes but it is interesting to see where it pops up and why.

To understand why this happens, one must explore the commonalities between the two examples. Both 35 and 15 have a common factor, namely 5. However, Z55 and Z85 do not exhibit the same properties as Z15 and Z35. So this is most likely a dead end.

The other thing that both examples have in common is that q = p+2, also known as twin primes. Indeed, it appears that this has something to do with why Z15 and Z35 have such interesting properties.

For example, 11*13 = 143 and the field Z143 exhibits the same interesting properties as Z15 and Z35 since:
143 = 11*13
131^2 = 1 mod 143
131+13 = 144 = 1 mod 143

Furthermore,
131+11 = 142 mod 143
142^2 = 1 mod 143

## 19.3.19

### The skewy revisited

A few years ago I boldly introduced a new term called "skewy", which I defined as the smallest square root of (n+1/2)2 mod n where n is the product of two distinct odd primes.

The skewy has an interesting relation to the Collatz conjecture and to the prime factorization of n.

Here are a few claims to consider:

Claim #1:   4*((n+1)/2)2 = 1 mod n

Claim #2:   The row at 4 of the exponentiation table of Zn consists of all squares co-prime with n.

Claim #4:   If s is the skewy, then 4*(s3 mod n) mod n = s.

Claim #5:   4*(((n+1)/2)3 mod n) mod n = (n+1)/2.

## 26.1.19

### The Collatz Connection

There is one integer sequence, which is keeping me up at night sometimes if I start thinking about it. It is the sequence of odd integers, which do not have 5 as a Collatz exit point. Why don't they? What is so special about them? But most importantly, how can we predict the next term of this sequence? What is the formula? This sequence is not in OEIS. The first few terms that I found are:

21,75,85,113,151,201 Not found in OEIS
The Collatz Conjecture is important for integer factorization. I recently read a very nice explanation of why this problem is important. I came up with a couple of interesting sequences in this vicinity: A276260 and A276290 but the sequence described above is something that troubles me in a mathematical sense.

On a personal note, I just learned today that the mathematician who first thought of the Collatz problem died while attending a Mathematics Conference in the city I was born in.

## 19.1.19

### Dreaming of Collatz Exit Points

A few years ago I talked about Collatz exit points. Some Collatz exit points are reached a lot more frequently than others.  In fact, it appears that most integers reach only one such point.

Here are the first few Collatz exit points: 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405, 22369621, 89478485, 357913941, 1431655765, 5726623061, 22906492245, 91625968981, 366503875925, 1466015503701, 5864062014805, 23456248059221, 93824992236885, 375299968947541

Note: I call them Collatz exit points because for each ai in the set above 3*ai + 1 = 2i+1

As I already mentioned here there are only 3 odd integers below 100, for which 5 is not a Collatz exit. Below 200 there are also only 3, below 300 there are also only 3.

It seems 5 is the most commonly occurring Collatz exit point for all odd integers below 1000.

...

## 12.1.19

### Non-Complimentary Primes

On the other side of complimentary primes are the non-complimentary primes, which are primes p for which the order of 2 mod p is odd.

The first few primes are 2,7,23,31,47,71,73,79,89,103,127,151 and more can be generated here using the following Mathematica line
Select[Prime[Range], OddQ[MultiplicativeOrder[2, #/(2^IntegerExponent[ #, 2])]]&]

In OEIS these primes are known as p  What's interesting to me about these primes is that their exponentiation table follows a very different pattern than that of complimentary primes, and it all seems to be dictated by the order of 2 mod p.

## 5.1.19

### Complimentary Primes

Definition: Complimentary primes are prime integers p such that 2k/2 mod p = p-1 where k is the order of 2 mod p.

Example: Let p = 43. It can be verified  that k = 14 since 214 mod 43 = 1 and 14 is the smallest such integer so 14 is the order of 2 mod 43. Since 27 mod 43 = 42 then 43 is a complimentary prime. Verified result

The first few complimentary primes are 5,11,13,17,19,29,37,41,43,53,59,61,67,83,97,101.

This is a sequence documented in oeis.org (more or less) as the sequence of primes p where the order of 2 mod p is even. What isn't documented there and what I find special about complimentary primes is the following conjecture that I made:

Conjecture: If p is a complimentary prime and k is the order of 2 mod p then
(2i (mod p)) + (2(k/2)+i(mod p)) = p for all i greater or equal to 0

Example: Let p = 43. Since k is the order of 2 and k = 14, then k/2 = 7
20 mod 43 = 1  and  27 mod 43 = 42,
21 mod 43 = 2 and 28 mod 43 = 41,
22 mod 43 = 4 and 29 mod 43 = 39
23 mod 43 = 8 and 210 mod 43 = 35,
24 mod 43 = 16 and 211 mod 43 = 27
25 mod 43 = 32 and 212 mod 43 = 11,
26 mod 43 = 21 and 213 mod 43 = 22
27 mod 43 = 42 and 214 mod 43 = 1

You can use the iFrame below to find powers of 2 modulo an odd integer.

## 17.10.18

### Self-sufficient exponents

Definition: A self sufficient exponent e is an exponent such that (me (mod n))e (mod n) = m for all m < n.

Conjecture: If n is a positive integer greater than 6, then there are at least 2 self-sufficient exponents smaller than lcm((p-1)(q-1)).

Example: Let n = 35, then 5, 7, 11 are self sufficient exponents because for all m < 35 (m^5)^5 = m, (m^7)^7 = m, (m^11)^11 = m. But also 17, 23, 29 are self-sufficient exponents.

Let n = 77, then 11, 19, 29 are self-sufficient exponents because for all m < 77 (m^11)^11 = m, (m^19)^19 = m, (m^29)^29 = m. But also 41, 49, 59 are also self-sufficient exponents.

Conjecture: If n is the product of two distinct odd primes p and q and k = ((lcm((p-1)(q-1))) - 1) then k is a self-sufficient exponent.

This has to do with the structure of the exponentiation table of Z sub n when n is the product of two distinct odd primes. https://en.wikipedia.org/wiki/RSA_(cryptosystem), last retrieved 17/10/18

## 26.9.18

### Finding a primitive root

I was just going over some old posts when I realized that I haven't talked about how to check if an integer k is primitive root of a prime p or a power of a prime p^r.

Conjecture: If k^((p-1)/2) mod p is equal to (p-1) then k is a primitive root of p.

To check if k is a primitive root of p:

1. Compute x = k^((p-1)/2) mod p
2. If x == (p-1) then k is a primitive root of p

For example, Let p = 11.
2 is a primitive root of 11 and 2^5 = 10 mod 11

Conjecture: If k^(((p-1)(p^(r-1)))/2) mod (p^r) is equal to (p^r - 1) and k is the smallest such integer then k is a primitive root of p^r.

Note that there might be other primitive roots other than the smallest one.

As discussed many many many times on this blog only p, p^r, 2p, or 2p^r where p is some prime and r is an integer greater than 0 have primitive roots. All other integers do not.

## 1.5.18

### Fun With Steganography

Steganography is the art of hiding secrets in plain sight. Modern algorithms allow the concealment of vast amounts of data into a single digital image without making significant changes to the image typically by appending the data into the least significant bits of the red, blue, or green channels of a pixel in an image.

This method of hiding binary strings into colour channels does not work for jpeg images because jpeg is a lossy format and it compresses the RGB information upon saving but it does work for lossless formats like png and bmp. For example, using 2 least significant bits we can hide 1.5 MB of data in a
desktop background image but if we only want to hide a 128 bit integer we can do so in the alpha channel of particular pixels.

A 128 bit integer is at most 39 digits long. Each digit is an integer between 0 and
9, which can be hidden in the alpha channel of consecutive pixels of a PNG
image. The alpha channel is the transparency channel and it is usually set to 0 unless the image contains transparent pixels. For example, in PHP's GD library the alpha channel of a pixel in a png image is an integer between 0 and 127 where 127 means that the pixel is transparent. Therefore changes to this channel such as increasing it to an integer less than 9 do not affect the overall appearance of the image. Furthermore, if the alpha channel of every other pixel in that image is made to be an integer between 0 and 9 then it would be hard to identify which pixels contain the message unless the starting point of the message is known.

Thus the starting point of the message is the key to retrieve the message from the image. One of the images below has a secret message in it and the other one has no transparency channel.

Below is the pseudocode for the ensteging and desteging functions respectively. I implemented this algorithm using PHP's GD library and the code and a demo are available here.

ENSTEG Function
1. For each pixel at location x == key*
a. Add a digit from msg array to alpha channel, move onto next digit
b. Save pixel
2. Add random digits to the alpha channels of other pixel as distraction

*where key = timestamp of image upload mod width/2 for example

DESTEG Function
1. For each pixel at location x == key
a. Grab alpha value
b. Put value into array
c. Return array

## 4.1.18

### Prime factorization using the smallest square root of a particular integer

If n is the product of two distinct odd primes p and q, then there are 4 square roots for each squared integer a such that GCD(a,n) = 1. There appears to be a relationship between the smallest square root of ((n+1)/2)^2 (mod n) and a multiple of p or q.

Conjecture 1.: Let n be the product of two distinct odd primes p and q. If s is the smallest square root of ((n+1)/2)^2 (mod n) then (n+1)/2 - s = rp such that GCD(rp, n) = p

Empirical evidence suggests that this conjecture holds for any n as long as n is the product of two distinct primes. In fact, the following algorithm can be used to factor n.

1. Calculate k = ((n+1)/2)^2 (mod n)

2. Find the smallest square root s of k mod n

3. Calculate xp = (n+1)/2 - s

4. Return GCD(xp, n)

Example:
a. Let n  = 35

1. k = 18^2 (mod 35) = 9
2. s = sqrt(9) = 3
3. xp = 18 - 3 = 15
4. GCD (15, 35) = 5

Step #2 can be further divided into two cases. The first case relates to k being a perfect square. If k is a perfect square then there is no need to use modular arithmetic to calculate the smallest square root of k. All known algorithms for computing the square root of a perfect square in Z will return the smallest square root of k. However, if k is not a perfect square in Z then finding its square root in Z_n becomes a different problem altogether.