Matlab Riemann-Zeta Unprovability Toolbox Functions

Download the Toolbox and associated Mac XCode RZViewer

Associated research:Experimental Observations on the Riemann Hypothesis and Collatz Problem

Full research facilities: http://dhushara.com/DarkHeart/


explicitformula(1,50,500,500,0)

function explicitformula(start,finish,its,xres,sav)
%plots a von-Mangoldt prime distribution based on the zeta zeros
%parameters start = first prime, finish = last prime,
%its = how many zeta zeros to use xres = number of x points in graph
%sav will save the arrays z, x if needed


fig1(1,240) and fig1(2,240)

function fig1(f)
%plots the sinusiodal modulus-angle images of the zeta and xi functions in fig 1 of the associated paper
% fig1(1) gives the zeta function, fig1(2) gives the symmetric xi function
%other functions below can be set instead and the region and colouring


fractdimgraph()

function fractdimgraph()
%plots the zeta zero gap graph for 10^4 zeros around 10^21
% fig1(1) gives the zeta function, fig1(2) gives the symmetric xi function


holo2(282.4651148, 283.2111857,1000,2)

function holo1(yin,its,range)
%plots the holomorphic flow around 1/2+iy for its steps over range range
%both as a grid of vectors and as curves starting at each clicked point.
%it also makes a numerical estime of whether the zeros is source or sink

function holo2(yin,y2in,its,range)
%plots the same grid and curves as above but starting from a small circle
%around 1/2+iy from y to y2 (a neighbouring zero)

function gaussmRI(i,siz)
%plots the Julia set image on right of fig 8 (right)
%i=no of steps of iteration of Gaussian wave function method


mygrizLSM(1,240)

function mygrizLSM(fn,siz)
%fn=1 draws the julia set of the gamma function at c=0
%fn=0 draws the julia set of the Riemann zeta function at c=0
%level set method for the Julia set of zeta separately plotting basin of attraction of infinity and the fixed attractor a


myrizLSM2c(400,100,0,1,0.001,240)

function myrizLSM2c(maxiter,huge,v,ww,tiny,siz)
% draws zeta julia sets colour indexed by attractors
%example myrizLSM2c(400,100,0,1,0.001,240)
%maxiter=max iterations in loop, huge=size of large target for divergence
%v=parameter value (i.e. c), ww=flag to write wait bar or not
%tiny=size of small target distance for checking periodicity
%maxiter=400; %huge=100; %tiny=.001; %suitable values
%Adjust for speed or accuracy


myrizLSMand(3,202,240),202,240)

function myrizLSMand(zeta,steps,siz)
%draws the additive Mandelbrot sets of zeta and gamma
%zeta=0 f(z)=gamma(z)+c parameter plane
%zeta=1 f(z)=zeta(z)+c parameter plane
%zeta=2 singular archipellago of zeta
%zeta=3 singular island of zeta


zerotest10(500,100,1000);

function [zp zr y]=zerotest10(n,its,terms)
%plots the distribution of iterates of zeros for multiplicative mandelbrot
%checking for periodicity and return to the zero
%e.g. zerotest10(500,100,1000);

function cc=zerotest12(opt)
%gets the unreal criticals of zeta or eta
%opt=1 eta =0 zeta

function c=zerotest12r()
%gets the real criticals of a function


zeros of the L-function of the elliptic curve 11a plotted for 1000 series terms

function cc=zerotest15()
%gets the zeros of any Dirichlet series in the critical strip
%the function can either be entered by modifying the coding
%or the coefficient set can be entered as a vector r, as in above ex.

zerotest22b
%generates finite period-five L-function series for an RZViewer movie interpolating intermediates with zeros fixed on the critical line, using a matrix fives.mat generated using zerotest15 and invertine to get coefficients ensuring zeros on the critical line as solutions and makes a movie of the coeficient vectors.

function pnth(n,mode)
%plots prim number theorem distributions
%mode=0 plots distribution of primes and the asymptotic log estimates
%mode=1 plots the fast Fourier transform of the prime distribution to look
%for correspondences to the zeta zeros. (use next function for results)


fint(10^3,0) followed by fint(10^3,1)

function fint(scale, mymode)
%plots Fourier sin transform of psi prime distribution giving zeta zeros
%if mode=0 saves the additive Mangoldt function psi
%if mode>0 loads psi and plots the graph
%e.g. scale=10^3 or 10^7


explicitduality(1,50,500,600,0,0)

function explicitduality(start,finish,its,xres,sav,prtits)
%e.g. explicitduality(1,50,500,600,0,0);
%plots sum(x^r) over zeta zeros r giving peaks at primes and prime powers
%parameters start = first prime, finish = last prime,
%its = how many zeta zeros to use xres = number of x points in graph
%sav will save the arrays z, x if needed prtits=1 print iterations
%a simplified version of explicitformula dual to the above Fourier transform

function fintstep(scale,start,finish,its,xres)
%fintstep(10^6,1,50,490,600);
%plots Fourier sin transform of integer step distribution
% (black) overlayed on the Mangoldt version of fint (green)
% giving minima coinciding closely with zeta zeros (blue)
%parameters start = first value, finish = last value,
%its = how many zeros to use xres = number of x points in graph
%produces four figures first Fourier transform, second compares distribution of the transform minima with zeta zeros, third differences of the two, fourth number distribution with peaks at integers and peak maxima at primes (blue).


see below for the commands used

function primeorbitp(b,n,mode,cl,stt,fin,scal,m)
%plots the orbit of successive terms in the cumulative product formula for zeta
%b=complex value, n=primes upper limit, mode as below
%cl clear figure, stt, fin start and finish values for curve
%scal scal for figure defauting to auto
%m is start value for calculting primes so the
%latter part of a fimction can be investigated
%so m,n governs the primes used and stt, fin the section of the curve

>>primeorbitp2(0.5+14.1347i,26300000,3,1,1,26300000)
primes=1642052 largest=26299991 y=0.9998 z=68.0292
min(z)=0.0000 av(log(z))=0.1070
>> primeorbitp2(0.5+14.1347i,26300000,5,1,1,26300000)
primes=1642052 largest=26299991 y=0.9998 z=68.0292
min(z)=0.0000 av(log(z))=0.1070


zeroseq2(20000,1,4,1);

function [v zz]=zeroseq2(zro,stps,mode,eta,xofs,yofs,fln)
% zro=zroth zeta zero y=coord stps=how many steps
%mode=-1 was searching for fluctuations ex 1/(1-2^(1-s))
%mode=0 generate vector v of iteration numbers
%mode=1 generate graph of iteration numbers
%mode=2,3 generate complex plot of iteration sequence 3 save mode 2 plots
%mode=4,5 plot real and imaginary parts 5 save
%eta=1 eta fn eta=0 zeta fn,
%xofs, yofs offsets from zero(zro) coods.
%fln file number numbered automatically if n=0
%e.g. [v zz]=zeroseq2(20000,1,4,1);

function zerotest4(zro1,zro2,eta,stps)
%e.g. zerotest4(100,103,199)
%plots a moving seriesconvergence sequence of zeta ir eta between zeros
%set to save the sequence of tifs to composit into a movie

inversemovie
Generates a movie of 101 images moving from Dirichlet L(5,2) to L(5,4) forcing the intermediate zeros to move linearly between on the critical line by solving an inverse problem for the coefficients.

gaussprimes.m
%generates an image of gaussian primes

function [vv lv]=grouptest3b(mn,ml)
% generates Dirichlet characters of cycle mn of type ml
% does not check for trivial or non-primitive mn, ml


cumulatively added product coefficients for the Dirichlet L-function L(7,2)

function cf=prodtest1(mm,nn)
%creates sum coefficients from a product formula pattern
%also checks converstion from sum to product and back
%will also plot individual or summed product coefficients
%can also use grouptest to generate Dirichlet characters

function primzeros(mode)
%graphs the distribution of zeros of zeta against GUE and GOE
%mode=1 compares prime and zero distributions
%mode=4 compares zero spacing and GUE and GOE graphs

function paircorrelation()
%forms the pair correlation distribution using 10^5 zeros

function delta(X)
%plots prime number delta function and its li(x) bound up to X
%compared to the Riemann hypothesis estimate of x^(1/2)/log(x)
%see the above research paper fig2(b) for the formula

function mertens(n)
%plots Mertens' sum of absolute moibius functions and sqrt bound (red)

function lindelof(n,m)
%plots lindelof conjecture that zeta grows more slowly than any power of z
%n=spread of imaginary values, m=x resolution

function eulp(z,n)
%finite prime product formula for zeta with n terms

function [f]=mygamma(z)
% complex gamma function using Lanczos approximation to extend to the entire plane.

function f=myzetas(z,steps)
%zeta function using eta function and analytic continuation via the Lanczos approximation to the gamma function.
%z=complex value, steps is how many steps in the sum
%sum completes with a half term to improve convergence near x=0.

function o=divisor2(n,pw,a)
%fast divisor sum function using prime factorization
%n=number, pw=power of divisor sum, a=1 subtracts n (aliquot sequence)
%gives Inf if n>2^32 (integer overflow)

function o=totient(n)
%Euler's totient function the number of integers z<=n coprime to n

function o=mangoldt(n)
%von Mangoldt function
%o=log(p) if n=p^k or 0 otherwise

function o=moibius(n)
%Moibius function
%o=(-1)^k if n has k distinct prime factors each of multiplicity 1
%o=0 otherwise

function aliquot(n,stps,plt)
%plots aliquot sequence of a specific number for stps steps
%iterations breaks if integer overflows or reaches 0


aliquotcher(1,200,0) and aliquotcher(1,1000,1)

function aliquotcher(nums,nums2,myfl)
%produces iteration charts of the aliquot sequence for incresing numbers
%nums and nums2 give start and finish integers
%blue chart shows orbit length to get to first repeat
%green chart shows period length
%if myfl=1 instead does scatter plot of maxima giving the hailstone diagram
%if myv(1:3)' at line 57 maxnumber in sequence is plotted


ccollatz(-2,2,-2,2,300)

function ccollatz(xmin,xmax,ymin,ymax, maxiter)
%plots the Julia set of the complex Collatz cosine or the reduced Collatz cosine
%to use the reduced Collatz (3n+1)/2 swap the functions below


see below for command used

function v=collatziter(s,t,myfl)
%explores one particular Collatz integer value
%s=value to test, t=no. of iterations, myfl 0=plot vals 1= web plot
%Example collatziter(-17,50,0)
%process stops and reports when it reaches a period

>> collatziter(-17,50,0)
-17,-50,-25,-74,-37,-110,-55,-164,-82,-41,-122,-61,-182,-91,-272,-136,-68,-34,-17,
Steps=19
Period=18
>>


cruncher(2,3,-20,30,0) and cruncher(2,3,-20,3000,1)

function cruncher(sm,bg,nums,nums2,myfl)
%forms an iterations/period chart for a range of Collatz values
%or a scatterplot of the hailstone diagram of the Collatz
%the function is either iterating n/sm (if mod(n,sm)=0) or bg*n+ad (ad the min factor to make a multiple of sm)
%usually sm=2 bg=3 ad=1 to give n/2 and 3n+1
%nums and nums2 give start and finish integers
%blue chart shows orbit length to get to first repeat
%green chart shows period length
%if myfl=1 instead does scatter plot of maxima