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
Natalie drew the angle below. What is the most reasonable estimate for the measure of the angel Natalie drew?
solong [7]
90 degrees, it looks like a right angle
Hope it helps :))
8 0
3 years ago
Read 2 more answers
Please help me with number 8. Thank you so much
Nastasia [14]
The are of the trapezoid is 125

4 0
3 years ago
Read 2 more answers
What is the equation of the line that passes through the point (-5,1) and has a slope of -1/5?
olchik [2.2K]

Answer:

x + 5y = 0

Step-by-step explanation:

y = mx + b

y = -1/5 x + b

1 = -1/5 (-5) + b

1 = 1 + b

b = 0

y = -1/5 x

5y = -x

x + 5y = 0

4 0
3 years ago
The table shows a hot air balloon’s height h, in feet, during a descent at various times t, in seconds.
11Alexandr11 [23.1K]
Do you have a picture my freind

7 0
3 years ago
Read 2 more answers
Which figures are polygons
Tatiana [17]
The answer is A. A, D the reason being, is because polygons have sides C, and B have no sides so we can eliminate those immediately.
5 0
3 years ago
Other questions:
  • Solve for x<br><br>2x+1=11<br><br>provide explanation please
    9·2 answers
  • A regular 6-sided die is tossed 5 times what is the probability that in two of those tosses we get a number less than 3
    13·1 answer
  • You roll a dice three times what is the probability that you roll an even number on the first roll, and odd on the second roll a
    12·1 answer
  • Suppose that you have the function f(x) = 9x^5 - 10x^4 - 2x. If f(c) = 1, what can you
    15·1 answer
  • The scale on a map is 1 cm = 30 km. The map distance between two towns is 3.5 cm. What is the actual distance between the two to
    6·1 answer
  • Find a.b. a=[4,1,1/4], b=[6,-3, -8]
    8·1 answer
  • -12/5 divided by -1/5
    15·1 answer
  • Simplify the following expression, show all work you did to get the results​
    9·1 answer
  • YOU WILL GET BRAINLIEST AND 22 POINTS PLS ANSWER!!!!!:
    13·1 answer
  • Just wanted to say this..
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!