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
A team won 6 hockey matches and lost 9 matches. what per cent of the matches did the team win​
Mama L [17]

Answer:

66.67%

Step-by-step explanation:

total matches = 9

matches won = 6

percentage = matches won*100/ total matches

percentage = 600/9

= 66.67%

7 0
3 years ago
Read 2 more answers
HELPPP PLSSSS THE PYTHAGOREAN THEOREM
maxonik [38]

Answer:

Step-by-step explanation:

a²+b² = c² c is always the longest line thats opposite to the 90 degree angle

for 1

15² + b² = 17²

b² = 17² - 15²

b = √(17² - 15²)

b= 8

8 0
3 years ago
(PLEASE HELP) What is the area of a circle with a radius of 8 units
ladessa [460]

Answer:

A = 64π units = about 201.06 units

Step-by-step explanation:

The formula for area is

A = πr^2, where r=radius.

Plug in our radius to get the area!

A = π8^2

<u>A = 64π = about 201.06 units</u>

8 0
4 years ago
Read 2 more answers
Please help me......................................
Irina18 [472]

Answer:

148.5

Step-by-step explanation:

times all

3 0
3 years ago
The multiplicative inverse of -7/8 is​
suter [353]

7/8 is a answer of this question

3 0
3 years ago
Other questions:
  • Determine how the next term in each sequence can be found. Then find the next two terms in the sequence
    13·2 answers
  • A rectangle has an area of k2+19k+60 square inches. If the value of k and the dimensions of the rectangle are all natural number
    13·1 answer
  • What is the simplest form of the expression -2x^2(x+5)+x(2x^2-10x)+x
    13·2 answers
  • What is the measure of each intercepted arc for each inscribed angle of a square inscribed in a circle?
    11·1 answer
  • Between which two consecutive numbers does √300 fall
    14·1 answer
  • Select the correct answer. A report on Americans’ attitudes toward eating out found that 73% of the respondents to the survey up
    12·2 answers
  • 6. Mr. Larson worked days during the week . On each day , he spent $ 7 on lunch . On Sunday , he spent $ 40 on lunch for his fam
    9·1 answer
  • katie can build three staircases to make 36 obstacles against the other player. how many staircases will she need to make 24 obs
    11·2 answers
  • Given the system below, which points are solutions? (check all that apply)
    7·1 answer
  • Calculate the side lengths using the given scale.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!