My prime counting function

J

JSH

Sieve form of my prime counting function:

With natural numbers x and n, where p_i is the i_th prime:

P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}

where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.

That simple algorithm will count primes out to positive infinity. And
yes, it is perfect.

It is the shortest representation of a prime counting function that
I've ever seen that is not just brute force i.e. check each natural
and see if it's prime.

If you code it, you can easily verify that it works. Just to be sure
you understand what I mean, note that P(100,4) = 25 as there are 25
prime up to 100, and P(10,2) = 4, where those primes are 2, 3, 5 and
7, and that [] is the floor() function, so [1.333]=1.

It is in actuality part of one of the most remarkable intellectual
finds in human history, and I did the research back in 2002, and for
my troubles the mathematical community has given me grief and
understanding this story is a lot about understanding the reality of
our academic world, and it's relevant here because I am also a Java
programmer with the open source project Class Viewer and I fear that
some of you completely have the wrong idea about me.

I am not a crackpot. I am a major discoverer who can prove it easily,
like with that prime counting function above, and even show you what
you have missed, like not getting taught it in school or seeing it in
journals or added to references, though I fully informed the
mathematical community years ago.

I like simplicity and elegance, which is why my Class Viewer project
is so minimalist and doesn't require a lot of instruction.

My research simplifies mathematics.

It simplifies it greatly.

If you do a search on "prime counting function" and read what
mathematicians traditionally teach you will get knocked over by
complexity.

Complexity gives room for paper, books, lectures and lots more
mathematicians doing research in an area than are actually needed.

Don't believe me?

Then, program the prime counting function. Look at what's out there
for prime counting functions. Notice mine is not given. Consider
that I have been beating the drums on this research since 2002 and try
to come up with a better explanation.

That is just one of my more minor results. The others are much bigger
and ALL of them are simplifying results.

I've been told by mathematicians that my prime counting function is
not important because they don't think it's interesting. But it is
the most compact representation of a prime counting function known,
other than brute force. It is the ONLY multi-dimensional prime
counting function that I know of. And it is a unique find that should
at least be cataloged.

But if I let it die, they would let it die. They would let the
knowledge be lost if they could, but I will not let them.

The trouble with a lot of people shouting conspiracy all the time is
that when you actually are faced with one you can say, it's not
possible or it has to be some crazy guy who just doesn't understand,
which is why I say: program the algorithm, look over the literature
and see.

And if you get really bold, just ask the mathematicians, and then see
what happens.

I have six years of experience of knowing what they do, so I have
nothing to learn there.

Quite simply, they will disappoint you.


James Harris
 
A

Andrew Thompson

Sieve form of my prime trolling function: ...
Don't believe me?

No, it's just I don't care, not until you post an
SSCCE (written in Java, to bring this rot 'on-topic').
...
Quite simply, they will disappoint you.

Your threads usually do.
 
J

JSH

There is nothing trolling about a simple but correct prime counting
function like this one.

Sieve form of my prime counting function:

With natural numbers x and n, where p_i is the i_th prime:

P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}

where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.

That is just a beautiful algorithm. It's knowledge. Knowledge isn't
supposed to be hidden by people behaving with hostility.

But like you the math community has responded to beauty in a bad way
for over six years now.
No, it's just I don't care, not until you post an
SSCCE (written in Java, to bring this rot 'on-topic').

Did you write a prime counting function in school if you even took a
computer science class?

Think about the knowledge you used if you did. It was more primitive
than it had to be.
Your threads usually do.

Hatred of knowledge by some is as old as humanity.

I think you react in anger because you are being protective of
mathematicians who I would guess are your heroes, right?

Hating a simple prime counting function kept from the world by small
minded people because you wish to protect them?

That is not acting in the best interests of the human race.

You can try to protect mathematicians if you wish.

But you do so in order to be just a little bit dumber than you would
be if you cherished knowledge instead.

I wonder if you did do a prime counting function for homework, ever.

If you didn't, other people did.


James Harris
 
R

Roedy Green

That simple algorithm will count primes out to positive infinity. And
yes, it is perfect.

If it is a Java program it can't go to infinity. ints longs and even
BigIntegers have finite limits.
 
C

Christian

JSH said:
Sieve form of my prime counting function:

With natural numbers x and n, where p_i is the i_th prime:

P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}

where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.

so I need to know how many primes there are to set the n.
Wouldn't it be easier then to not count the primes as one already knows
them?

Also if I know the primes p_i so i can iterate over them ... the I
practically have them already counted?
or does you algo not just use Bruteforce to find p_i ?

basically way easier would be
P(x,n) = sum for i=1 to n of i
and let n be the number of primes in x

As for any large number the count n will be larger than sqrt(x)
So I need to know the number of primes beforehand for the cacukation of
the count?

Christian
 
J

JSH

Maybe so.  But don't confuse your trolling with the
advocacy, promotion or investigation of knowledge.

Now that's just being deliberately cruel. I have a prime counting
algorithm that is a marvelous compact slice of knowledge that just
begs to be known, for an audience of people, many of whom had to
program such algorithms during school but never got a chance to see
mine--unless they did some Google searches and got lucky.

You can assert what you wish about me, but the knowledge stands on its
own, even if you repeatedly delete it out in your replies.

I'm just a guy who found something really cool, and was surprised--
over 6 years ago--when instead of being celebrated I was insulted by
the very people who supposedly loved the kind of find I had made.

Talk about disillusionment.

My even bothering to talk about this now is an act of faith in
humanity, which is being tested as usual by people like you.

I must still have faith in people, or what do I do then?


James Harris
 
J

JSH

If it is a Java program it can't go to infinity. ints longs and even
BigIntegers have finite limits.

Well, if you program it, you will probably find your typical desktop
computer will take too long at around x=10^10, or 10^11.

Back when I thought that developing a really fast algorithm would
being attention to my work I got a program in Java that would count
prime up to 10^14 in about an hour, with todays computers it'd take
maybe half an hour. It was still way too slow though to compete with
the fastest algorithms known, and after a time I quit that effort.
The program is PrimeCountH.java and is out there in cyberspace
somewhere for those who wish to run it.


James Harris
 
J

JSH

JSH said:
Sieve form of my prime counting function:
With natural numbers x and n, where p_i is the i_th prime:
P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}
where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.
That simple algorithm will count primes out to positive infinity.  And
yes, it is perfect.

But sadly, not in Java.

   BugBear

I have programs in Java implementing the algorithm. I posted them
years ago so I can just do searches to post them here but I don't
think that would help much.

There are 6 years of me talking about this research so I've tried just
about everything.

It amazes me though how easily people think that someone like me is
just some outlier because they don't understand how they stay within
the bounds of what society allows, because they're comfortable there.

People at the edges are at the limits of what society allows, even
when that edge is the cutting edge of knowledge.

I'm sure most of you think of yourselves as decent people who are
probably egalitarian but how many of you wouldn't flip out if you
walked into work tomorrow and the person who you saw before cleaning
the bathrooms and the floors was in place as a lead developer?
Smiling at you and talking about helping you program with your current
project?

Ever occur to you that the belief inside your head that is not
possible is really about social forces that MAKE it not possible?

The myth of the math field is that even a janitor could make a major
discovery and mathematicians would just accept it.

But like you, or most people, who accept class distinction without
question, because social structures are important to how we feel about
ourselves, mathematicians here have chosen to simply ignore the math
from the guy they think of as a nobody.

But I'm a nobody to them because I don't have a Ph.D in math--my
degree is in physics where I only have a B.Sc. from Vanderbilt
University.

But regardless, for them in their world, acknowledging a major
research result from me would be like you just accepting tomorrow the
janitor turned lead programmer, so they MAKE it not happen by simply
saying, no.

They just refuse to acknowledge the result and so preserve their class
and social structures as they exist today and they've done that for 6
years now.

But in your world I am the administrator for the Class Viewer for Java
project hosted on SourceForge.net, and I was a professional programmer
for a few years, and I was a lead programmer for a multi-million
dollar software project done in Java, so in your world I am not the
janitor.

But in the math world I might as well be to the mathematicians.
Understand now?


James Harris
 
J

JSH

JSH said:
JSH wrote:
Sieve form of my prime counting function:
With natural numbers x and n, where p_i is the i_th prime:
P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}
where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.
That simple algorithm will count primes out to positive infinity.  And
yes, it is perfect.
But sadly, not in Java.
   BugBear
I have programs in Java implementing the algorithm.  I posted them
years ago so I can just do searches to post them here but I don't
think that would help much.

I'm sorry - in that case, what is your purpose in posting
here?

I'm rather confused.

   BugBear

Good question.

Originally I was curious to see if I could get some info about use of
my Class Viewer program, where that post dropped like a stone, which
might have been it.

But then, out of the blue I had this idea for this algorithm for
tackling the Traveling Salesman Problem, and posted it here. Why
here? Well years of experience on certain other newsgroups meant I
KNEW up front that it wouldn't go well on them, and hey, here I might
get some people interested in coding the thing as in the back of my
mind was coding this approach and trying to get help as I went the
single developer route with Class Viewer and wonder now if that was
the best way.

I got some good feedback about my TSP algorithm, but also got (and
gave) some abuse including some person linking to that hate page
against me on crank.net, and then I just dropped out of that
discussion completely as I've been down that flame war road and don't
like it.

And THAT might have been it, but as I kept pondering my latest ideas
and thinking about my old ones it bugged me again how easily knowledge
is REALLY held back in the real world versus the fantasy of eureka and
people cheering you own, so I found myself talking about my prime
counting function--6 years old people--maybe really out of a need to
just talk with SOMEONE, ANYONE about this nightmare but also out of a
sense of faith?

And then I had this epiphany: mathematicians tell the lie that even a
janitor could get recognized for a major math result, but hey, that
has big class consequences and it's clearly a social lie, so I came up
with the analogy of developers out there going to work and finding the
janitor they saw working at cleaning the day before is now the lead
developer on their project, and is ready to give them coding advice.
And that epiphany put it all in perspective.

And then it was all clear and sitting here this morning I actually
feel a lot better.

Mathematicians may be liars about the janitor thing but who among us
really is not class conscious? Who among us really would just accept
merit rather than rely on social structures that help ensure our own
social positions against sudden upheaval?

If math people really would accept anyone who came up with a major
math result then they could go to bed with one class position and
status relative to just about anyone and wake up with another.

No human groups accept that. None.


James Harris
 
J

JSH

Actually, if you're talking about maths,
a really clean "expository" implementation
would be of more interest.

   BugBear

What's not clear about this algorithm?

Sieve form of my prime counting function:

With natural numbers x and n, where p_i is the i_th prime:

P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}

where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.

P(100,4) = 25. There are 25 prime numbers up to 100, where you need
the first 4 prime numbers which are 2, 3, 5 and 7 with that algorithm
to get that count.

What's not clear?


James Harris
 
A

Andrew Thompson

..
I must still have faith in people, or what do I do then?

Oh, I've just realized! You're entirely right, JSH,
everybody else (including me) is completely wrong.
You *do* deserve a pony.
 
D

Daniele Futtorovic

Good question.

Originally I was curious to see if I could get some info about use of
my Class Viewer program, where that post dropped like a stone, which
might have been it.

But then, out of the blue I had this idea for this algorithm for
tackling the Traveling Salesman Problem, and posted it here. Why
here? Well years of experience on certain other newsgroups meant I
KNEW up front that it wouldn't go well on them, and hey, here I might
get some people interested in coding the thing (...)

Err.. isn't it rather that you went at loggerheads in every newsgroup
where it might have been on topic and that you tried a clean start?

Doesn't mean you're wrong altogether, but between a rock and a hard
place nonetheless.
 
W

willo_thewisp

James said:
But in your world I am the administrator for the Class Viewer for Java
project hosted on SourceForge.net, and I was a professional programmer
for a few years, and I was a lead programmer for a multi-million
dollar software project done in Java, so in your world I am not the
janitor.
James: Just for clarification, you ARE referring to your programming
job at Alltel in Atlanta---the one you were fired from for
incompetence.
Right?
 
J

JSH

Err.. isn't it rather that you went at loggerheads in every newsgroup
where it might have been on topic and that you tried a clean start?

I'll admit I'm a great believer in the adversarial process because I
figure that the truth will stand after all the fire and fireworks.

Besides, I hate it when people just agree with me.

It's too easy. I've had enough experience with people just nodding
along with me to last a lifetime. Don't like it. Don't want it.
Don't need it.
Doesn't mean you're wrong altogether, but between a rock and a hard
place nonetheless.

Not really. Supposedly the saving grace IS actually being right and
being able to prove it.

What I found is that proof is not enough.

I think pondering that should give you goosebumps as it could be you.

And if it were you, you'd be in as tough a position as I am, no matter
what you think.

Social structures help us and protect us, or they block us in the
preservation of the current order.

Only when you get on the outside do you understand just how powerful
the forces are, like great ocean currents where most people are swept
along so they never know...

Thanks for the post! I'm more sanguine now as I contemplate a simple
answer that while it leaves things still up in the air, it makes
sense.

Sometimes, it is so important just to understand why.


James Harris
 
D

Daniele Futtorovic

I'll admit I'm a great believer in the adversarial process because I
figure that the truth will stand after all the fire and fireworks.

Yeah... that would really soothe my mind if I were immortal.

Besides, I hate it when people just agree with me.

Yep, I agree. :)prod:)

It's too easy. I've had enough experience with people just nodding
along with me to last a lifetime. Don't like it. Don't want it.
Don't need it.

Absolutely. :)prod: :prod:)

Not really. Supposedly the saving grace IS actually being right and
being able to prove it.

What I found is that proof is not enough.

You have probably found that proof itself has a social component. While
there *is* such a thing as "absolute" proof -- logic, causality,
dialectic, the like; which would seem to derive from the basic
properties of matter and, as I'm being told, from the fact that the
universe goes from higher to lower entropy and not the opposite --,
while there is such a thing, it matters little, in the short term at
least, if there is no social consensus about it.

Trouble is that none of us is immortal, and that the "short term" may
well span a whole life.

I don't mean to sound cynical, nota bene.
 
J

JSH

Yeah... that would really soothe my mind if I were immortal.

Think so? I don't get that. Like, if you're waiting on something?

What would you be waiting on?
Yep, I agree. :)prod:)


Absolutely. :)prod: :prod:)




You have probably found that proof itself has a social component. While
there *is* such a thing as "absolute" proof -- logic, causality,
dialectic, the like; which would seem to derive from the basic
properties of matter and, as I'm being told, from the fact that the
universe goes from higher to lower entropy and not the opposite --,
while there is such a thing, it matters little, in the short term at
least, if there is no social consensus about it.

Why don't you Google "definition of mathematical proof" and read what
I just checked now is coming up #2?

(Yeah, I wrote it.)

Social consensus has nothing to do with mathematical proof.

Nothing.
Trouble is that none of us is immortal, and that the "short term" may
well span a whole life.

I don't mean to sound cynical, nota bene.

That's not cynical.

If you buy into the notion that you're working to convince people of
something then you can lose beauty. I think at your best--and you
should always do your best!!!--you're working to find beauty, and then
you're hoping to find some people to share in that, but if not, life
goes on.

Now doesn't it.


James Harris
 
G

gjedwards

Think so?  I don't get that.  Like, if you're waiting on something?

What would you be waiting on?






Why don't you Google "definition of mathematical proof" and read what
I just checked now is coming up #2?

(Yeah, I wrote it.)

Social consensus has nothing to do with mathematical proof.

Nothing.



That's not cynical.

If you buy into the notion that you're working to convince people of
something then you can lose beauty.  I think at your best--and you
should always do your best!!!--you're working to find beauty, and then
you're hoping to find some people to share in that, but if not, life
goes on.

Now doesn't it.

James Harris

Or you could just read a dictionary of math:

For example, according to The Harper Collins Dictionary of
Mathematics:
proof n. a sequence of statements, each of which is either validly
derived from those preceding it or is an axiom or assumption, and the
final member of which, the conclusion, is the statement of which the
truth is thereby established.
 
J

JSH

Actually, if you're talking about maths,
a really clean "expository" implementation
would be of more interest.
   BugBear

What's not clear about this algorithm?

Sieve form of my prime counting function:

With natural numbers x and n, where p_i is the i_th prime:

P(x,n) = x - 1 - sum for i=1 to n of {P([x/p_i],i-1) - (i-1)}

where if n is greater than the count of primes up to and including
sqrt(x) then n is reset to that count.

P(100,4) = 25.  There are 25 prime numbers up to 100, where you need
the first 4 prime numbers which are 2, 3, 5 and 7 with that algorithm
to get that count.

What's not clear?

James Harris

I think it interesting that I didn't get a reply because now I can
talk about the really frustrating part of this saga with my discovery
which is that, yes, over the last six years I have talked to
mathematicians including leaders in the area of mathematics that cover
counting primes and the prime distribution and while they've been
polite, at the end of it all they usually just do nothing.

When pressed I hear that they feel they have the right to only pay
attention to research that personally interests them.

So think about that: if some professors at universities around the
world thought that sieve form of my prime counting function were
interesting, 6 years ago, then some of you if you've recently
graduated with computer science degrees might have been learning it in
college.

But because they decided the information wasn't I guess "sexy" enough
to them personally, you get it from some guy apparently ranting on
newsgroups, but if you code it, you will see it works well enough.

That's kind of frustrating but it's also social reality. New ideas
generally have an uphill battle in terms of acceptance.

Years from now for students around the world that may be THE sieve
form prime counting function.

And they'd be surprised to hear that anyone bothered with anything
else, or read it as just interesting history.

Yeah I find that rather odd to say but I'm using my own variant of
Occam's Razor where a simpler prime counting function, easier to
present and easier to explain will win out, like in an evolutionary
process--down the line.

But it's kind of like my definition of mathematical proof coming up
now so highly in Google searches.

Just to see I just typed into Google: my definition of mathematical
proof

And of course my definition of mathematical proof comes up #1 here on
the West Coast search though I suspect that is true across the United
States though it may not be true in other countries but I'd guess it's
also true in Great Britain and Australia.

That's wild to contemplate on the social side (whatever it really
means) but on the survival-of-the-fittest side, it maybe simply
reflect a highly useful putting together of words that is information
purely, and our new tech pulls out the inevitable future of its
dominance faster than happened in the past so I get to puzzle over it
now versus forgetting about it and maybe seeing these ideas dominate
in a few decades, like normal.

Processing of information has sped up thanks to the web.

Social organizations, not surprisingly, have not.

When it comes to them, old tech is still in force, so I suspect that
mathematicians believe they can simply say, not personally interesting
when confronted with my research, as by the old ways they could have
decades before the information dominated, while with the new systems,
arguably, like with my definition of mathematical proof, that idea
acceptance has already visibly begun.

Welcome once again to our brave new world. Maybe evolution is pushing
information at us faster than social structures can stand, so the
question is, who will win? Or should I say, what?


James Harris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Any Ideas On This Simple Co-Prime program 1
Function for primes 0
Prime Numbers 19
Langton's Ant 0
Prime number generator 11
Java 8 Streams and Eratosthenes 22
Solutions for finding the 1000th prime 2
Java 1

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top