Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:25:43+00:00 2026-05-28T06:25:43+00:00

My problem reduces to finding the number of primes between two given numbers.I could

  • 0

My problem reduces to finding the number of primes between two given numbers.I could have a range as big as 1 to (1000)! and hence I am need of some mathematical optimizations.

Clearly the sieve method would be too slow in this case. Is there any mathematical optimization that can be applied – like for instance, taking a smaller subset of this large space and making inferences about the rest of the numbers.

P.S: It definitely looks like I might have reached a dead end – but all that I am looking for are some optimizations that could possibly help solve this. And also, I am only looking for a single-threaded approach.

EDIT: One approach I have been thinking and can solve a lot of large prime number related problems – is for someone to maintain a global table of primes and make it available for lookup. Folks at the PrimeGrid project can contribute usefully towards this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:25:43+00:00Added an answer on May 28, 2026 at 6:25 am

    Since you want to go as high as 1000! (factorial). You will not be able to get exact results with currently known methods on current technology.

    The Prime Counting Function has only been evaluated exactly for a handful of values up to 10^24. So no way you’ll be able to hit 1000!.


    But since you mention than an approximation may be fine, you can use the Logarithmic Integral as an approximation to the Prime Counting Function.

    This is based on the Prime Number Theorem which says that the Prime Counting Function is asymptotic to the Logarithmic Integral.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have reduced my problem to finding the minimal spanning tree in the graph.
I have a problem with auto_ptr in Exception classes, that I eventually reduced to:
The problem is: Manipulating external state in a test file reduces the possible parallelism
I have to split a number into its digits in order to display it
The problem reduces to counting \n characters, so is there a function that can
I use Fraction for representing fractions, but the problem is it reduces to the
do you have any info about the subject? any problem with boost::shared_mutex in particular
This is possibly a problem with possibly no optimal solution. Suppose I have a
My try at code golfing. The problem of finding the minimum value of ∑W_i*|X-X_i|
I came across this problem of finding said probability and my first attempt was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.