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
The answer i’m on a timer
8_murik_8 [283]

Answer:

D. Down 5, Left 2

Step-by-step explanation:

-5 on the outside means it will go down 5.

+2 directly grouped with the variable means it will do the opposite, so it goes left 2.

7 0
3 years ago
Which expression is equivalent to 2cos2(x/2)-cos(x)
Pavel [41]

Answer:

B

Step-by-step explanation:

Edge

3 0
2 years ago
A function is a relation in which every input has exactly one output. Which choice represents a function?
Damm [24]
The top answer is a virus please DONT click it
4 0
3 years ago
In the parallelogram w
Ilia_Sergeevich [38]

Answer:

can't see any parallelogram

7 0
3 years ago
Read 2 more answers
Solve this system of linear equations. Separate
Katyanochek1 [597]

Answer:

good question

Step-by-step explanation:

5 0
3 years ago
Other questions:
  • Evaluate. (−6+8)−2 Please help me
    12·2 answers
  • Carolos is baking bread and uses 3/8 cup of sugar in one load and is making 6 loafs so how much sugar die he use:
    14·1 answer
  • draw a rectangle and another figure that is not a rectangle by tracing lines on a grid paper.describe how to find the perimeter
    15·1 answer
  • I need help pweeeessss
    6·1 answer
  • Can someone help me figure this out? -2(x+8)=6x+8
    7·1 answer
  • Help me more 10 points
    7·1 answer
  • Which expression is equivalent to ( 2/5 x + 1 1/5)?
    12·1 answer
  • Write an<br> i explicit formula for an, the nth term of the sequence 200, 40, 8, ....
    6·1 answer
  • A group of 3 friends are practicing for a track meet. The group is going to run 7 12 miles total. If they each run the same dist
    9·1 answer
  • Worth 10 points ! need help asap
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!