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 graph of 0.5x - 2y = 3 is shown on the grid.
Salsk061 [2.6K]

Answer:

It's D because 2y and 0.5x both have a vrible besilde it .

6 0
3 years ago
Convert the rate 5 feet per 3 seconds to yards per hour
deff fn [24]
5 feet per seconds is 100 yards per hour. So 5 feet per 3 sec will be...?
8 0
3 years ago
Simplify fraction 40/85
Leona [35]
Divide both the numerator and denominator by 5 and you get 8/17. your answer is 8/17.
7 0
3 years ago
2x+5y=11 and 4x+3y=1 solve with elimination
storchak [24]
Multiply you first equation by 2 to get 4x + 10y = 22
Now the x terms can be eliminated and cancelled out using elimination.
4x + 10y = 22
4x + 3y = 1

To eliminate you need to "subtract", so you need to multiply one of the equations by -1. 

4x + 10y = 22
-4x -3y = -1
------------------
0 + 7y = 21
y = 3

Now plug 3 into either one of the equations to get x.
7 0
3 years ago
Tyler went to the grocery store and purchased cans of soup and frozen dinners. Each can of soup has 300 mg of sodium and each fr
Katena32 [7]

Answer:

<u>Tyler purchased 10 cans of soup and 5 frozen dinners.</u>

Step-by-step explanation:

1. Let's review the information given to us to answer the question correctly:

Amount of sodium per can of soup = 300 mg

Amount of sodium per frozen dinner = 550 mg

They all collectively contain 5,750 mg of sodium

Tyler purchased twice as many cans of soup as frozen dinners

2. Determine the number of cans of soup purchased and the number of frozen dinners purchased.

Let s to represent the number of cans of soup Tyler purchased

Let d to represent the number of frozen dinners Tyler purchased

Let's write our equation of systems:

s = 2d (1st equation)

300s + 550d = 5,750 (2nd equation)

************************************************

Substituting s and solving for d in the 2nd equation:

300s + 550d = 5,750

300 * 2d + 550d = 5,750

600d + 550d = 5,750

1,150d = 5,750

d = 5,750/1,150

<u>d = 5 ⇒ s = 2 * 5 = 10</u>

<u>Tyler purchased 10 cans of soup and 5 frozen dinners.</u>

Let's prove d = 5 and s = 10 are correct:

300 * 10 + 550 * 5 = 5,750

3,000 + 2,750 = 5,750

5,750 = 5,750

<u>We proved d = 5 and s = 10 are correct</u>

3 0
3 years ago
Other questions:
  • Pls help me with 24. Thanks
    6·1 answer
  • What is the probability of someone correctly guessing your Social Security number on the first attempt? (Assume all digits 0-9 a
    10·1 answer
  • . A team of divers assembles at an elevation of -10ft relative to the surface of the water. Then the team dives at a rate of -50
    7·1 answer
  • PLEASE ANSWER I NEED HELP!!! ​
    12·1 answer
  • Brainlies please give me one 100 pontes if you give me a brainlies (give me a brainlies)
    7·2 answers
  • chris wxamines under his microscope. he finds that it is a cube with each side length 6 millimeters draw one square face of the
    8·1 answer
  • Rena has posters that measure 8 inches wide by 10 inches tall. If she uses a poster maker which creates similar posters, what is
    10·1 answer
  • ????????????????????????????????????????
    11·2 answers
  • Help i need help on this question​
    14·1 answer
  • There are 6 red marbles, 8 blue marbles, and 11 green marbles in a bag. What is the probability that you will randomly draw eith
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!