55 690
Assignments Done
97,5%
Successfully Done
In November 2017
Your physics homework can be a real challenge, and the due date can be really close — feel free to use our assistance and get the desired result.
Be sure that math assignments completed by our experts will be error-free and done according to your instructions specified in the submitted order form.
Our experts will gladly share their knowledge and help you with programming homework. Keep up with the world’s newest programming trends.

Answer on Combinatorics | Number Theory Question for Ritvik

Question #26088
how many integers from 1 to 19999 have exactly 15 divisors ?
Expert's answer
package divisors; import java.util.ArrayList;
import java.util.List;

public class Divisors {

public static void main(String[] args) {

int number = 19999;
int answer =countdivisor(number);
System.out.print("Answer:");
System.out.println(answer);
}

public static int countdivisor(int number) {
List<Integer> list = newArrayList();
int j = 0;
int countOfNumbers = 0;
int divisors = 0;
while (j <= number) {
divisors = 0;
for (int i = 1; i<= j; i++) {
if(j % i == 0) {
divisors++;
}
}
if (divisors ==15) {
countOfNumbers++;
list.add(j);
}
j++;
}
System.out.println("List ofnumbers:");
for (Integer i : list) {
System.out.println(i);
}
System.out.println("");
return countOfNumbers;
}
}

List of numbers:
144
324
400
784
1936
2025
2500
2704
3969
4624
5625
5776
8464
9604
9801
13456
13689
15376
16384

Answer:19

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question