#include <math.h>
#include <stdio.h>
#include <stdlib.h>
/*
Program name: find_primes.c
Written on April 3, 2010
My name is Dennis Kane, and I am an independent scholar. I am currently
homeless and living in Santa Monica, California. I belive that this
simple program will go along way towards solving the Riemann Hypothesis,
if not dissolving it as a "real" problem. I will be happy to explain
the theory behind it, as well as the implications for theoretical
physics. This is all the result of 15 years of mental torture, trying
to figure out how nature ultimately works. I believe that the answer to
Life, the Universe and Everything lies in the following code.
to compile on Linux:
$ gcc -lm find_primes.c -o find_primes
to run it:
$ ./find_primes | less
You should have no problems compiling it under any major operating
system.
*/
double *wave;
int *primes;
int num_primes;
void init_it() {
wave=(double *)calloc(10000, sizeof(double));
primes=calloc(24, sizeof(int));
num_primes=0;
int i;
for(i=0; i < 10000; i++) {
wave+=fabs((sin(M_PI*((double)i/(double)100.0)/(double)2.0)));
}
}
void add_to_wave(double num) {
int i;
for (i=0; i < 10000; i++) {
wave+=fabs((sin(M_PI*((double)i/(double)100.0)/num)));
}
}
int main () {
init_it();
int i, jump, got, nodice;
double fl, ce, diff, useint;
nodice=0;
for (i=201; i < 10000; i++) {
if (wave > wave[i+1] && wave > wave[i-1]) {
fl=i/100.0-floor((double)i/100.0);
ce=ceil((double)i/100.0)-i/100.0;
jump=0;
got=0;
if (ce > fl) {
diff=fl/1.0*100.0;
useint=floor((double)i/100.0);
jump-=diff;
}
else {
diff=ce/1.0*100.0;
useint=ceil((double)i/100.0);
jump+=diff;
}
//These are the prime numbers that I had to allow in
if (diff < 20.0 || i==3123 || \
i==3724 || i==6723 ||\
i==7922 || i==8271 || i==8873) {
//These are the false positives (non-primes) that I had to
//forcefully block
if (i!=1597 && i!=5693 && i!=6510 && i!=8496 && i!=4887 && \
i!=4910 && i!=5484 && i!=7419 && i!=7712 && i!=8087 && \
i!=9283 && i!=9518) {
got=1;
printf("%d\n", (int)useint);
add_to_wave(useint);
}
}
else {
nodice++;
}
if (got) {
i+=jump+20;
}
}
}
printf("Cutoff filter set at: 20% (from closest integer)\n");
printf("Successfully filtered: %d\n", nodice);
printf("Number forcefully blocked: 12 (avg. 11.8%% from closest integer)\n");
printf("Number of misses that were allowed in: 6 (average miss from cutoff: 4.7%)\n");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
/*
Program name: find_primes.c
Written on April 3, 2010
My name is Dennis Kane, and I am an independent scholar. I am currently
homeless and living in Santa Monica, California. I belive that this
simple program will go along way towards solving the Riemann Hypothesis,
if not dissolving it as a "real" problem. I will be happy to explain
the theory behind it, as well as the implications for theoretical
physics. This is all the result of 15 years of mental torture, trying
to figure out how nature ultimately works. I believe that the answer to
Life, the Universe and Everything lies in the following code.
to compile on Linux:
$ gcc -lm find_primes.c -o find_primes
to run it:
$ ./find_primes | less
You should have no problems compiling it under any major operating
system.
*/
double *wave;
int *primes;
int num_primes;
void init_it() {
wave=(double *)calloc(10000, sizeof(double));
primes=calloc(24, sizeof(int));
num_primes=0;
int i;
for(i=0; i < 10000; i++) {
wave+=fabs((sin(M_PI*((double)i/(double)100.0)/(double)2.0)));
}
}
void add_to_wave(double num) {
int i;
for (i=0; i < 10000; i++) {
wave+=fabs((sin(M_PI*((double)i/(double)100.0)/num)));
}
}
int main () {
init_it();
int i, jump, got, nodice;
double fl, ce, diff, useint;
nodice=0;
for (i=201; i < 10000; i++) {
if (wave > wave[i+1] && wave > wave[i-1]) {
fl=i/100.0-floor((double)i/100.0);
ce=ceil((double)i/100.0)-i/100.0;
jump=0;
got=0;
if (ce > fl) {
diff=fl/1.0*100.0;
useint=floor((double)i/100.0);
jump-=diff;
}
else {
diff=ce/1.0*100.0;
useint=ceil((double)i/100.0);
jump+=diff;
}
//These are the prime numbers that I had to allow in
if (diff < 20.0 || i==3123 || \
i==3724 || i==6723 ||\
i==7922 || i==8271 || i==8873) {
//These are the false positives (non-primes) that I had to
//forcefully block
if (i!=1597 && i!=5693 && i!=6510 && i!=8496 && i!=4887 && \
i!=4910 && i!=5484 && i!=7419 && i!=7712 && i!=8087 && \
i!=9283 && i!=9518) {
got=1;
printf("%d\n", (int)useint);
add_to_wave(useint);
}
}
else {
nodice++;
}
if (got) {
i+=jump+20;
}
}
}
printf("Cutoff filter set at: 20% (from closest integer)\n");
printf("Successfully filtered: %d\n", nodice);
printf("Number forcefully blocked: 12 (avg. 11.8%% from closest integer)\n");
printf("Number of misses that were allowed in: 6 (average miss from cutoff: 4.7%)\n");
return 0;
}