1. Member
Join Date
May 2008
Posts
1
Rep Power
0

## Prime numbers

Hello, I am trying to solve this problem:
A positive integer is said to be k-smooth if none of its prime factors exceeds k. Compute how many positive integers less than or equal to N are k-smooth.
Input

The input contains multiple test cases (less than 50). Each test case consists of two lines. The first one contains an integer N (1 ≤ N ≤ 5,000,000), the second one an integer k (1 ≤ k ≤ 1000).
Output

For each test case output a single line with the corresponding answer.

Can anyone help me? thanks

2. whats your problem. Nobody is going to do your assignment for you.

3. Nobody is going to do your assignment for you.
Maybe that is he's problem....

What have you done so far?

4. Line of sequential thinking leading to success in this:
1 generate some primes to be sure you can do so
2 for a given integer N find the primes that are factors of N
3 for a given limit k see if any of the primeFactors exceed k
4 print result

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•