1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nookie1986 [14]
3 years ago
7

A twin primes is a pair of prime numbers such that the difference between them is 2. For example, 5 and 7 are twin primes, and 1

7 and 19 is another pair of twin primes. Write a program that finds all the twin primes between 10 and 500, save the results in a two-column matrix, and output result nicely formatted. You can use the built-in function, isprime().
Mathematics
1 answer:
Nikitich [7]3 years ago
7 0

Answer:         There is 22 possible combinations.

Step-by-step explanation:

%a is equal or greater then 11 and it is odd

count=0;

P=[];

for a=11:2:499

   b=a+2;

   %assume a and b are prime;

   prime=1;

   %check if a and b are prime

   for k=2:ceil(sqrt(b))

       %if a OR b is divisible by k, break

       %it is not prime

       if mod(a, k)==0 | mod(b, k)==0

           prime=0;

           break;

       end

   end

   if prime

       count=count+1;

       P(count, :)=[a b];

   end

end

fprintf('There is %d possible combinations.\n', count)

display(P)

There is 22 possible combinations.

P =

   11    13

   17    19

   29    31

   41    43

   59    61

   71    73

  101   103

  107   109

  137   139

  149   151

  179   181

  191   193

  197   199

  227   229

  239   241

  269   271

  281   283

  311   313

  347   349

  419   421

  431   433

  461   463

You might be interested in
X-6 1/3 ≤ 1 1/2<br><br> Correct solution set
rjkz [21]

Answer:

down

Step-by-step explanation:

7 0
3 years ago
Solve for x help pleaseeeee
Zolol [24]
X-5=40 x=45 can I get the crown?
8 0
3 years ago
Read 2 more answers
Every day the Washington pet store uses 3/4 of a bag of dog food to feed the dogs his many days will 1 1/2 bags of dog food last
harkovskaia [24]

Answer:

2 days

Step-by-step explanation:

3 0
4 years ago
Can you help me if 1/2=q+2/3 what is q
eduard

Answer:

hope this helps

Step-by-step explanation:

q =−1/6

7 0
3 years ago
In right triangle ∆ABC, ∠A = 42°. Find the measure of ∠B which is the other non right angle.
Zigmanuir [339]

Answer:

48 degrees

Step-by-step explanation:

A triangle has three angles that add up to 180 degrees. In a right triangle, one of the angles in 90 degress, and the other 2 add up to 90. In this case, we have 2 given angles, 90 degree angle and 42 degree angle. If we do 90+42 it gives us 132. We then subtract that from 180 to give us 48 degrees.

4 0
3 years ago
Other questions:
  • Which is closer to Earth, Venus on<br>Mars? How much closer is it?​
    12·2 answers
  • What is the measure of A and C, A = (12x + 12), b = (15) C =(3x + 18)°
    14·1 answer
  • What is 48÷2(9+3)= ???
    7·2 answers
  • What’s the answer is ?
    11·2 answers
  • Use graphs and tables to find the limit and identify any vertical asymptotes of limit of 1 divided by the quantity x minus 6 as
    8·1 answer
  • The 12th term of a sequence is 84. The common ratio is 4. What is the 11th term?
    13·1 answer
  • 5.3 - 4.2 <br> What does this equal
    13·1 answer
  • A carton has a length of 2, reet, whath of 3 reet, and height of 5 feet. What is the volume of the
    11·1 answer
  • Suppose someone gives you 6 to 1 odds that you cannot roll two even numbers with the roll of two fair dice. This means you win 6
    14·1 answer
  • Find the equation of the line.<br> Use exact numbers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!