Place your bets.
Place your bets
Other urls found in this thread:
mathworks.com
en.wikipedia.org
en.wikipedia.org
en.wikipedia.org
en.wikipedia.org
twitter.com
∑1/π(n) ~= ∫ln(x)/x ~= 215
I would programming using Sieve of Eratosthenes on Java.
I don't know matlab but your program will be more fast using this
mathworks.com
loop over primes list.
primes(n) creates a single array of the first n primes, which can get huge. So it's restricted by memory. MATLAB won't allow arguments past a certain value.
here
Slight correction: primes(n) creates an array of primes less than or equal to n. Still a single array, though.
yeah put that filthy normie in his place
definitely wrong kek
>using matlab
fucking why
python is free, easier, more forgiving, and has libraries that have anything you might need.
>doesn't use matlab
Lol pleb, do you even uni?
Because if I used python, some insufferable faggot would ask why I'm not using MATLAB.
i used matlab in undergrad because i was a lazy shithead like OP that didn't want to look into alternatives. python is even easier to use than matlab, has an interpreter, and is not as slow.
I'm tempted to do it in Excel now, just to make you squeal.
do it. i'll be surprised if it won't crash.
So would Bill Gates, I'm sure.
OP here. I doubt anyone's waiting on the edge of their seat for this, but if you are, I'd (very roughly) estimate seven more hours to finish. Could be a lot more, given the increasing intervals between primes... hell, depending on how the isprime function works, it could already be in an infinite loop.
If it's still going in twelve hours, I'll kill it and see what it got to.
i determined the result using a sieve of eratosthenes in C
3.4332861011375368
your program will never terminate
haven't been into programming lately but i think your inner while loop will never end
any news OP?
what is this software
The matlab isprime function is very fast (Miller-Rabin).
Just wanted to drop in and berate you for doing k=k+1 instead of k=k+2.
wew, OP you goofed
op never returns
>very fast (Miller-Rabin).
kek
interesting question, is the sum of the reciprocals of the primes expected to converge?
>interesting question, is the sum of the reciprocals of the primes expected to converge?
no, it is a divergent series
en.wikipedia.org
thanks
>Just wanted to drop in and berate you for doing k=k+1 instead of k=k+2.
as if this makes any significant difference.
the complexity of testing a multiple of 2 is O(1)
testing every other number has a complexity of O(klog^3 n) (as per wikipedia)
so iterating over multiples of 2 produces a negligible extra cost
Pleb detected.
taking a look at this page en.wikipedia.org
we get 3.433285778848619
which is 3x10^-7 less than your result
indeed, we should expect this to be lower as n < infinity
i'm betting will be a very precise estimate
(provided OP delivers)
explain
performing the algorithm 10^9 times is slow as fuck compared to using sieve of eratosthenes
en.wikipedia.org
en.wikipedia.org
it's the less shitty version of GNU Octave
i ran the program using quad-precision floats this time to get
3.4332861011360211253759993728579925452503513520343194288703092984459640246708289623711607418954372406005859375
any news OP?