on another thread now
Hi there,
I'm a totally non maths guy. But I've looked at primes for fun over the last few weeks...
By your definition (not divisible by 2,3,5) I can tell you there are 26 'prime like' numbers between 0-100 28 in 100-200 & 26 between 200-300
What might be useful for you to know is that there are 80 such numbers between 0-300 and then the sequence repeats itself.
In other words in 0-900 there will be 240 'prime like' numbers in 0-90000
there will be (90000/300 x 80) 24000 etc.
In a number not divisible by 300 eg. 1000 just go 1000/300 = 3 remainder 100 so there are 3x80 + 28 (number of 'prime likes' in 0-100)
So 268 'prime like' numbers between 0-1000.
The sequences for your 'very prime like' numbers also start repeating themselves at various intervals and I can give you a cumbersome formula for the answer, but I'm sure an actual maths guy could explain it better.
The above is probably useless to you, just trying to contribute while I wait for someone to answer my post as well.
Start with 100. Subtract out the 50 multiples of 2, the 33 multiples of 3, and the 20 multiples of 5. Merely subtracting these numbers puts us in the negative, because there is a lot of overlap, double and triple eliminating certain numbers. So, go into the negative, and then add back in the 16 multiples of 6, the 10 multiples of 10, and the 6 multiples of 15. Now we have another problem, as we've double un-eliminated the 3 multiples of thirty. After all of this, , as Not2l8 computed.
Here is the pattern:
Recognizing that these factor as follows:
We can simply add when the number of factors is even, and subtract when odd:
Where represents the boolean digits of , represents literally the number of "on" digits, or how many prime factors are in the denominator, and is an independent variable representing the first prime numbers.
This is an admittedly complicated equation, but works much better as a computer program, crunching large numbers very quickly. Setting n=6 gives you the primes 2,3,5,7,11,13 as you request in your post.
Also note that for an "approximation" just drop the floor functions and use the GCD to combine all these fractions. This will give you a polynomial of degree n with rational coefficients that will do the job.
Try out the experiment I mentioned in my first paragraph for yourself, and you can see the pattern. If you follow me to here...
... you can proceed with the following:
The floor function literally means "round down to the nearest integer" so if we remove the floor functions we get an approximating equation:
Realizing that we can easily get a common denominator, we have:
Therefore approximately 8 in 30 numbers on the number line are "primelike" as you call them. By stripping the original exact equation of the floor functions, we introduce an error of at most +1 for the positive terms and -1 for the negative terms. Therefore,
The number of primelike integers under x is given by:
Similarly, the number of very primelike integers under x is:
So about 27% of all numbers are primelike, and 19% are very primelike. As an added bonus, the error percentage of this estimate decreases very quickly. For example, using this equation, there are approximately 191808 very primelike numbers under a million, give or take 32, which is an error margin of only .0032%
*Note: I made the statement earlier that the exact form of this sieving equation works better as a computer program than an equation. If the approximation is what you are after, then I hope this post is clear. If you are interested in experimenting with the exact answers, let me know and I can provide you with the pseudocode that puts this formula into action. If you are familiar with computer programming, you can therefore create a program that returns an exact answer staggeringly quickly, as in fractions of a second even for numbers so large the computer has just barely enough memory to hold them.
hi i followed the first bit and got this:
so are these the prime like numbers less than 100? will i have to start again for 1000, by subtracting and adding numbers that arent prime like?
also, whats the pi 3 bit here, and the similiar ones seen in the other equations?
finally, how did the 4 turn into a 32 in this:
In number theory, actually has nothing to do with the number , and instead literally means "the number of primes less than or equal to x." For example, , because there are 25 primes under 100, and since 101 is itself prime. Since this can be construed as "the number of ints under x not divisible by 2,3,5,7,11,13,17,..." I thought it a fitting notation to call the function "the number of ints under x not divisible by 2,3,5, the first 3 primes" as . Similarly, I am calling "the number of ints less than or equal to x not divisible by 2,3,5,7,11,13, the first 6 primes." Please understand this is just my own personal choice of notation here. This habit, as you know, comes from the desire to generalize these kinds of results. Now, for all eternity, we can call the function "the number of positive integers less than or equal to x that are not divisible by the first n primes."also, whats the pi 3 bit here, and the similiar ones seen in the other equations?
Alas, the exact value of is , not just for x up to 100 or 1000, but for every number on the number line.
This equation is simply the final result of calculations I did not include in my post, because they are way too long. The equation above for only contains 8 terms ( ). However, the equation for , if you care to expand it, contains 64 terms , involving coefficients of up to 5 digits. (I cheated and used a computer )finally, how did the 4 turn into a 32 in this:
Similarly, the equation for contains 4 negative terms and 4 positive terms, therefore the approximation could be off by as high as +4 or as low as -4. Whereas, contains 32 negative terms and 32 positive terms, therefore the approximation could be off by as high as +32 or as low as -32. Again, the reasoning behind this is that by ignoring the floor function , each term could be off by at most 1, as , for example, throwing the answer off by .86 if we chose to ignore the floor function.
Ah, yes, I see what you were referring to now. Yes, that was indeed a typo. May God strike me down.
Well, Not2l8 seems to have used a computer to verify that the sequence repeats in blocks of 300. In fact it repeats in blocks of 30.would a question of this sort rely on these methods that you have used in number theory? or would there be approaches using basic school mathematics as well?
Here is a visual for you. In bold are the primelike numbers:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
The fact that they appear to line up in columns is not a coincidence. Suppose n<30 is primelike. Then n leaves a nonzero remainder when divided by 2,3, or 5. So let for some x,y,z and nonzero a,b,c. Then look at n+30: . So n+30 also leaves a nonzero remainder when divided by 2,3, or 5. Therefore, if n is primelike, n+30 is also primelike, and vice versa. Since there are 8 primelikes between 1 and 30, the number of primelikes under x is approximately
What makes 30 special is that 30=lcm(2,3,5)=2*3*5. Hopefully this is "basic school" enough. However, the error bit is probably impossible to extract out of this line of reasoning. You would just have to commit the first 8 primelike numbers to memory, and apply the following logic: Take 522. Since 522=510+12=30*17+12, there are 17*8=136 primelikes up to 510, and since there are 3 between 1 and 12, there are 3 from 511 to 522.
For the very primelike case, this process repeats in blocks of 30030, more than you probably want to have to hand-calculate and memorize. If you did, however, choose to count up and memorize the first 5760 very primelike numbers, then you could apply all the same logic as in the previous example.
*Note: The practical application for what you are doing is finding prime numbers quickly. Since a prime greater than 30 must be primelike, then ALL prime numbers over thirty must be of the form 30k+a, for a={1,7,11,13,17,19,23,29}
thanks a lot that answers it
on a side note, since you've done number theory, when you try to solve how many triangular numbers are square numbers, it comes to this pell equation: x^2 - 2y^2 = 1
have a look at the link: Square Triangular Number -- from Wolfram MathWorld
how do i solve the pell's equation now? is it reasonable to presume that there are infinite many integer solutions for any pell's equation?
this is also a case, square pentagonal numbers:
Pentagonal Square Number -- from Wolfram MathWorld
Though this equation is theoretically correct, I cannot think of a single practical way to use it.
Consider what we have proved earlier, that
Which can be written as
(All we're doing here is simply prime-factoring the denominators.) Notice that in the denominator, every combination of three 0's and 1's is used in the exponents. The following numbers are the boolean representations of integers 0 through 7: . In the above equation, they appear out of order, so let's rewrite again:
Since each of these terms correspond to a number 0 through 7, create a sequence called such that if we find the boolean representation of , then
The last pattern to notice is that of the signs. I do not know of a straight-up formula mapping {0,1,2,3,4,5,6,7} to {+--+-++-}, but the rule nonetheless is simple: If there are an even number of 1's, you use +, and if there are an odd number of 1's, you get -. So let represent the number of 1's in the boolean representation of i, so . As you know, when we put -1 to an even power, the result is +1, and when put to an odd power, the result is -1, the exact pattern here. So adjust as follows:
Now, simply add all eight terms together, and you have your answer:
The biggest use of this way of writing is acknowledging that the same basic algorithm works whether we use 3 primes, 6 primes, or 600. Generalizing,
Hopefully this post is clear enough to follow. Again, I stress that this equation cannot be simplified in any way I know of, and is practically useless at calculating actual values for an arbitrary x. It is the most compact way of expressing the sieving algorithm outlined in my first post. If you truly want to test it out, I can help you with a computer program accepting x and n as inputs and spitting out
ah thanks! so for the means of this question, i just use the approximation method u used, i.e. being
Try out the experiment I mentioned in my first paragraph for yourself, and you can see the pattern. If you follow me to here...
... you can proceed with the following:
The floor function literally means "round down to the nearest integer" so if we remove the floor functions we get an approximating equation:
......
but the other one u showed is the actual formula, which isnt required for this as such. that makes sense.
why do they ask about the "explain your reasoning carefully" part with the very prime like under 10^10, and 10^100? Is that to do with that the percentage error is decreasing like you said?
Well, it depends on what the exact wording on the question is. Do they want an approximate answer, an error margin? Or do they want an exact answer, regardless of the method? Are you allowed to use a computer? Having now equipped yourself with three or four different ways of solving this problem, you might ask the person who posed this question in the first place which line of attack might be most appropriate.why do they ask about the "explain your reasoning carefully" part with the very prime like under 10^10, and 10^100? Is that to do with that the percentage error is decreasing like you said?
I think the key challenge of the question is the fact that there is no way to trial divide every integer from 1 to , forcing you to come up with something clever. The answer, by the way, so you can check your work, is about
thanks a lot! ill ask him and let u know if there is any confusion.
I think i asked earlier im not sure, but do u know if the pell equation:
x^2 - 2(y^2) = 1
will have infinite integer solutions? it was to do with that triangular square numbers stuff and pentagonal square numbers