1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 68 78 88 89 90 91 92 93 94 95 96 97 98 99 100
1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Look for a table of prime numbers. All the odd numbers that are NOT on this list are composite numbers.
The cubed numbers from 1 to 100 are 1, 8, 27, 64. These correspond to the cubes of the integers 1 through 4 (1³=1, 2³=8, 3³=27, and 4³=64). The next cube, 125 (5³), exceeds 100, so the list ends there.
That's an infinite list.
25 percent of the numbers from 1 to 100 are prime numbers.
101
1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Look for a table of prime numbers. All the odd numbers that are NOT on this list are composite numbers.
In Java:System.out.println("Even numbers")for (int i = 2; i
Here's simple example to sort numbers in Java using a List: import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SortTest { public static void main (String[] args) { List<Integer> list = new ArrayList<Integer>(); list.add(100); list.add(1); list.add(24); list.add(3); System.out.println(list); Collections.sort(list); System.out.println(list); } } Running it generates the following output: [100, 1, 24, 3] [1, 3, 24, 100]
The cubed numbers from 1 to 100 are 1, 8, 27, 64. These correspond to the cubes of the integers 1 through 4 (1³=1, 2³=8, 3³=27, and 4³=64). The next cube, 125 (5³), exceeds 100, so the list ends there.
4, 9, 25, 49
That's an infinite list.
The only factor common to all those numbers is 1.
25 percent of the numbers from 1 to 100 are prime numbers.
Usually all the integers (counting numbers) from 1 to 100.Usually all the integers (counting numbers) from 1 to 100.Usually all the integers (counting numbers) from 1 to 100.Usually all the integers (counting numbers) from 1 to 100.
Prime squares: 4, 9, 25 and 49