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
Please Factor completely and explain thanks
Ivahew [28]
(4h+2)(2h+8)

4htines 2h= 8h^2
4htimes8=32h
2 times 2h=4h
2 times 8=16
Add Middle two you have
8h^2+36h+16
6 0
3 years ago
Read 2 more answers
Which is the outlier in this set of values?<br> 17 20 19 10 15 19 14 0 11 16
Musya8 [376]

Answer:

Zero is the outlier.

Step-by-step explanation:

the rest of the numbers are all two-digit numbers while zero is one digit and farther away on a number line.

hope i helped!

8 0
3 years ago
What is the slope and y-intercept of the line graphed below?
nasty-shy [4]

Answer:

A

Step-by-step explanation:

7 0
3 years ago
I need to know the answers
Lelu [443]
Really dude I don't even no that but maybe someone else
5 0
3 years ago
What is -12x-17=-125
xxMikexx [17]

Answer:

X = 9

Step-by-step explanation:

4 0
2 years ago
Other questions:
  • Michael threw for 1,654 yards in his first five games. At this rate, how many yards will he have thrown for in fifteen games? ✗
    6·2 answers
  • Use the subtraction property of equality to complete the following statement:
    8·1 answer
  • A distributor buys packs of trading cards from a wholesaler for $0.80 each. The distributor marks up the cards by 100% before se
    5·2 answers
  • What is the value of s?
    14·1 answer
  • I made up this question please explain this to me in detail explanation I am trying to understand Triangle Similarity what would
    15·2 answers
  • With water from one hose, a swimming pool can be filled in 9 hours. A second, larger hose used alone can fill the pool in 2 hour
    10·1 answer
  • 65 divide into 8,0000
    6·1 answer
  • Simplify the expression: (3m + 1)(2)
    14·2 answers
  • N which number does the digit 5 have a value that is ten times greater than the value of the digit 5 in the number 245,093?
    12·1 answer
  • The marked price of a dozen of copies is Rs 600. If the shopkeeper allows 20% discount and then charges 10% VAT, how many copies
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!