Wednesday, April 19, 2017

A mathematicians's miscellany (Littlewood)


"I once challenged Hardy to find a misprint on a certain page of a joint paper: he failed. It was in his own name : 'G,H.Hardy'."

"Schoolmaster : 'Suppose x is the number of sheep in the problem'. Pupil: 'But, Sir, suppose x is not the number of sheep'. [I asked Prof. Wittgenstein was this not a profound philosophical joke, and he said it was.]"

("A Mathematician's Miscellany", J.E.Littlewood, 1953)

Monday, April 17, 2017

Trying to refine Ingham's prime gap expression

Sometimes it is difficult to get feedback about a calculation or the steps of a proof. This is one of those cases. This is a mirror of my question at MSE.

Let $p_n$ denote the $n^{th}$ prime number. Ingham showed that:
$$p_{n+1} - p_n \lt K p_n^{\frac{5}{8}}$$
where $K$ is a fixed positive integer, is an upper bound for the prime gaps.

(A.E.Ingham, On the difference between consecutive primes, Quart. J. Math. Oxford Ser. vol. 8 (1937) pp. 255-266)

I am trying to know if the following manipulations would be valid to reduce the value $\frac{5}{8}$ up to $\frac{1}{8}$. The steps $1,2,3$ have been verified in, but still I am trying to get some help to review the rest of them.

1. Both sides to the eighth: $$(p_{n+1} - p_n)^8 \lt K^8 p_n^{5}$$
2. Def. $K_2 = K^8$ a new fixed constant $K_2 \gt K$: $$(p_{n+1} - p_n)^8 \lt K_2 p_n^{5}$$
3. By Fermat's Little Theorem, we know that $p_n^{5}$ can be replaced as follows}: $$p_n^{5}= 5K^{'} + p_n$$
For a given positive unbounded constant $K^{'}$. Thus: $$(p_{n+1} - p_n)^8 \lt K_2 (5K^{'} + p_n)$$
But (credits for the following explanation to a MSE user here) the map $$ K' : \mathbb{P} \to \mathbb{N} : p \mapsto \frac{p^5 - p}{5}$$
is not constant and unbounded from above.

$\color{red}{From\ this\ point\ ahead\ the\ manipulations\ need\ to\ be\ verified}$.

The right side of the inequality can be replaced as follows: $$(p_{n+1} - p_n)^8 \lt K_2 (5K^{'} + p_n) = (K_2 \cdot 5K^{'}) + K_2 p_n$$
Our partial refinement will be true only if the constants are fixed, so we need to add a condition to handle the unbounded constant $(K_2 \cdot 5K^{'})$. So let us assume the following condition:

Condition 1: $$ p_n^{5}-p_n = 5K^{'} \lt K_2 = K^8$$

So from now on, the partial refinement will be valid only those primes $p_n$ whose value $p_n^{5}-p_n$ is bounded by the eighth power of Ingham's $K$ constant.

4. Def. $K_3 = K_2^2$ an even bigger new fixed constant $K_3 \gt K_2$: $$(p_{n+1} - p_n)^8 \lt K_3 + K_2 p_n$$
5. As $K_3 \gt K_2$, it is also true that: $$(p_{n+1} - p_n)^8 \lt K_3 + K_2 p_n  \lt K_3 + K_3 p_n = K_3 (1+p_n) \lt K_3 (2p_n) = (2K_3)p_n$$
6. Def. $K_4 = 2K_3$ as an even bigger new fixed constant $K_4 \gt K_3$: $$(p_{n+1} - p_n)^8 \lt K_4p_n$$
7. Now we make again the $8^{th}$ root in both sides: $$p_{n+1} - p_n \lt K_4^{\frac{1}{8}}p_n^{\frac{1}{8}}$$
8. Finally, def. $K_5 = K_4^{\frac{1}{8}}$ as a new fixed constant. In this case $K_5 \lt K_4$ but still fixed and positive: $$p_{n+1} - p_n \lt K_5p_n^{\frac{1}{8}}$$
Only valid under Condition 1: $$ p_n^{5}-p_n \lt K^8$$
being $K$ the original Ingham's $K$ constant.

Thus, if the manipulations and redefinition of constants are correct:

1. If $ p_n^{5}-p_n \lt K^8$: $$p_{n+1} - p_n \lt K_5 p_n^{\frac{1}{8}} = 2^{\frac{1}{8}}K^2 p_n^{\frac{1}{8}}$$
for a fixed constant $K_5 = K_4^{\frac{1}{8}}=(2K_3)^{\frac{1}{8}}=(2K_2^2)^{\frac{1}{8}}=(2(K^8)^2)^{\frac{1}{8}}=2^{\frac{1}{8}}K^2$, and

2. In the rest of unbounded cases remains as the original Ingham's expression: $$p_{n+1} - p_n \lt K p_n^{\frac{5}{8}}$$
I have asked at MSE if this is correct or not, and if it is useful or not. If it is correct, is just valid for a finite range of prime numbers $p_n=2,3,5...$ as long as $ p_n^{5}-p_n \lt K^8$. If I receive an answer I will write here the results too.

Tuesday, April 11, 2017

Are quaternions useful as coordinate systems for two-dimensional manifolds?

This is complementary information about my question at MSE "Are quaternions useful as coordinate systems for two-dimensional manifolds?" that I cannot add there due to the weight of the images and the length of the question. 

 This is the evolution of the first 500 steps of a test:


Same with some motion blur (basically is just a visualization test):


This is the Python code, please use and modify it freely:

 def quat():
    from sympy import mobius, factorint, totient
    from gmpy2 import is_prime, is_square
    import matplotlib.pyplot as plt
    import csv
    from random import randint
    from math import sqrt, log, cos , sin , tan, pi
  
    test_n_limit = 7000
    test_loop_limit = 500
    loa = []
    loi = []
    loj = []
    lok = []
    A=2
    I=100
    J=100
    K=4
      
    # Generating first positions of the elements
    for n in range (0,test_n_limit):
        loa.append(randint(0,A-1))
        loi.append(randint(0,I-1))
        loj.append(randint(0,J-1))
        lok.append(randint(0,K-1))
  
    for i in range(0,test_loop_limit):
        nloa = []
        nloi = []
        nloj = []
        nlok = []
        removed=[]
        for n in range (0,len(loa)):
            if n in removed:
                continue
            collided=False
            for m in range (n+1,len(loa)):
                if m in removed:
                    continue
                if loa[n]==loa[m] and loi[n]==loi[m] and loj[n]==loj[m] and lok[n]==lok[m]:
                    collided = True
                    removed.append(m)
                    # The collision produces a new point generated by a quaternion sum and the former points dissapear
                    nloi.append((loi[n]+loi[m])%I)
                    if (loi[n]+loi[m] >= I):
                        # The point goes out of the surface from the right, so it goes to the other side of the Mobius band
                        nloa.append((loa[n]+1)%A)
                        nloj.append(J-1-((loj[n]+loj[m])%J))
                    else:
                        nloa.append(loa[n])
                        nloj.append((loj[n]+loj[m])%J)
                    nlok.append((lok[n]+lok[m])%K)
                  
                elif loi[n]==loi[m] and loj[n]==loj[m] and lok[n]==lok[m]:
                    collided = True
                    removed.append(m)
                    # The collision produces a new point generated by a Hamiltonian product and the former points dissapear
                    nloa.append(((loa[n]*loa[m])-(loi[n]*loi[m])-(loj[n]*loj[m])-(lok[n]*lok[m]))%A)
                    nloi.append(((loa[n]*loi[m])+(loi[n]*loa[m])+(loj[n]*lok[m])-(lok[n]*loj[m]))%I)
                    nloj.append(((loa[n]*loj[m])-(loi[n]*lok[m])+(loj[n]*loa[m])+(lok[n]*loi[m]))%J)
                    nlok.append(((loa[n]*lok[m])+(loi[n]*loj[m])-(loj[n]*loi[m])+(lok[n]*loa[m]))%K)
                  
            if collided==False:
                # A collision did not happen and the point moves in a random walk
                incx = randint(-1,1)
                incy = randint(-1,1)
              
                nloi.append((loi[n]+incx)%I)
                if (loi[n]+incx >= I) or (loi[n]+incx < 0):
                    # The point goes out of the surface from the right or left, so it goes to the other side of the Mobius band
                    nloa.append((loa[n]+1)%A)
                    nloj.append(J-1-((loj[n]+incy)%J))
                else:
                    nloa.append(loa[n])
                    nloj.append((loj[n]+incy)%J)
                nlok.append(lok[n])
              
        print_up_i_0=[]
        print_up_j_0=[]
        print_down_i_0=[]
        print_down_j_0=[]
        print_up_i_1=[]
        print_up_j_1=[]
        print_down_i_1=[]
        print_down_j_1=[]
        print_up_i_2=[]
        print_up_j_2=[]
        print_down_i_2=[]
        print_down_j_2=[]
        print_up_i_3=[]
        print_up_j_3=[]
        print_down_i_3=[]
        print_down_j_3=[]
        for n in range (0,len(loa)):
            if loa[n]==0:
                if lok[n]==0:
                    print_up_i_0.append(loi[n])
                    print_up_j_0.append(loj[n])
                elif lok[n]==1:
                    print_up_i_1.append(loi[n])
                    print_up_j_1.append(loj[n])
                elif lok[n]==2:
                    print_up_i_2.append(loi[n])
                    print_up_j_2.append(loj[n])
                elif lok[n]==3:
                    print_up_i_3.append(loi[n])
                    print_up_j_3.append(loj[n])
              
            else:
                if lok[n]==0:
                    print_down_i_0.append(loi[n])
                    print_down_j_0.append(loj[n])
                elif lok[n]==1:
                    print_down_i_1.append(loi[n])
                    print_down_j_1.append(loj[n])
                elif lok[n]==2:
                    print_down_i_2.append(loi[n])
                    print_down_j_2.append(loj[n])
                elif lok[n]==3:
                    print_down_i_3.append(loi[n])
                    print_down_j_3.append(loj[n])
      
        # Draw current status
        print_up_i_0.append(0)
        print_up_j_0.append(0)
        print_up_i_0.append(I)
        print_up_j_0.append(J)
        plt.plot(print_up_i_0,print_up_j_0,"b,")
        plt.plot(print_down_i_0,print_down_j_0,"r,")
        plt.plot(print_up_i_1,print_up_j_1,"b.")
        plt.plot(print_down_i_1,print_down_j_1,"r.")
        plt.plot(print_up_i_2,print_up_j_2,"b*")
        plt.plot(print_down_i_2,print_down_j_2,"r*")
        plt.plot(print_up_i_3,print_up_j_3,"b+")
        plt.plot(print_down_i_3,print_down_j_3,"r+")
        #plt.show()
        #figure.set_size_inches(18, 16)
        plt.savefig("Topology_MobiusBand_quaternion_"+str(i)+".png")
        plt.clf()
      
        loa=nloa
        loi=nloi
        loj=nloj
        lok=nlok

quat()