Thread: Prime Factors

  1. #1
    Registered User
    Join Date
    Feb 2016
    Posts
    2

    Question Prime Factors

    Let M(p,q,r,N) be the largest positive integer less than N or equal to N that has only p, q AND r as its distinct prime factors. For example, M(2,3,5,100) will be 90, as 90 = 2 * 3^2 * 5. Note that all prime numbers (p,q and r) should be factors of the number. Find M(3,7,11,1000). I don't know the approach.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,730
    Unless you keep doing the same boring thing all the time, you will always encounter a problem where you don't know the approach. However, you might have some ideas to try, so give them a try.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Prime Factors
    By mgcpovoleri in forum C++ Programming
    Replies: 6
    Last Post: 06-29-2012, 02:43 PM
  2. Replies: 3
    Last Post: 02-19-2009, 10:32 PM
  3. Prime Factors
    By Adrian in forum C++ Programming
    Replies: 3
    Last Post: 10-02-2007, 09:01 PM
  4. Finding prime factors
    By ripper079 in forum C Programming
    Replies: 3
    Last Post: 05-17-2002, 09:23 PM

Tags for this Thread