I have given all computer science genii a challenge. It is so impossible it is possible. You have to write codes that can do the following things:

*(a)* Be able to print the Riemann zeta function of any number.

*(b)* Be able to print off the first 10000 primes without using the Sieve of Eratosthenes

*(c)* **(extension)** Be able to print numbers in exact values for *(a)*. *e.g.* \(\pi/6\)

You can write in any language. Special prize for the winner, which will be said after the challenge has been completed.

## Comments

Sort by:

TopNewestChallenge

(b)in python.EDITHere is a straight forward way of generating primes without a sieve.For each \(N\),check if any of the primes \(< \sqrt{N}\) you previously generated divide it. If they do not,then it is a prime and you can add it to the list of primes and print it out.

Another way of solving this problem is by going through each number and then use a very fast primality testing algorithm such as Miller Rabin to check for primality.

In Java:

Log in to reply

– Sharky Kesa · 2 years, 9 months ago

Nice.Log in to reply

– Ranadeep Biswas · 2 years, 9 months ago

when internet is down, try to print with it.. :DLog in to reply

– Thaddeus Abiy · 2 years, 9 months ago

ur right..was a bit lazy..Ive added moreLog in to reply

Printing first 10000 primes -

Log in to reply

For (a), Im using

JavaScriptIm not very good at JavaScript, so, this may not be the most efficient way to calculate the required value, but this does give an approximation for the Riemann Zeta of a number – Anish Puthuraya · 2 years, 9 months ago

Log in to reply

this. – Thaddeus Abiy · 2 years, 9 months ago

Look atLog in to reply

– Anish Puthuraya · 2 years, 9 months ago

Thanks a lot...I have edited the comment using the method suggested there...Log in to reply

– Anish Puthuraya · 2 years, 9 months ago

Run the code on the console of any browser, or just make a HTML file that links to the javascript file which contains the above code..Log in to reply

\[ Code for a) & b) \]

Log in to reply

(a), (b) and (c) using Mathematica (and I think I could solve them using Sage too).

Anyway, do not take this solution into consideration (as if you would), because it is ridiculously unfair with who is using Python, C, C#, Java, Haskell, ... to solve it.

– Bernardo Sulzbach · 2 years, 9 months agoLog in to reply

Minor typo - in (c) it has to be \(\pi^2/6\) – Bogdan Simeonov · 2 years, 9 months ago

Log in to reply

– Sharky Kesa · 2 years, 9 months ago

Well, it is an example, not the zeta function answer.Log in to reply

\[\zeta{\left(-19.9960230838937361197456702051425768393\right)}\approx{}\frac{\pi{}}{6}\] – Bernardo Sulzbach · 2 years, 9 months ago

Log in to reply

What does problem (c) mean? – Daniel Lim · 2 years, 9 months ago

Log in to reply

– Sharky Kesa · 2 years, 9 months ago

Read it again, I edited it.Log in to reply

– Daniel Lim · 2 years, 9 months ago

extension means web extension?Log in to reply

– Sharky Kesa · 2 years, 9 months ago

No, as in it is in a higher order of difficulty.Log in to reply

– Daniel Lim · 2 years, 9 months ago

ok, how about exact forms?Log in to reply

– Sharky Kesa · 2 years, 9 months ago

Their exact values.Log in to reply

– Daniel Lim · 2 years, 9 months ago

how many significant digits?Log in to reply

– Sharky Kesa · 2 years, 9 months ago

When I said exact values, if it has infinite digits like \(\pi\), it shows it as the string value assigned to pi. If it has lots o digits, give it in the form of an equation.Log in to reply

Imgur

Log in to reply

– Sharky Kesa · 2 years, 9 months ago

:PLog in to reply