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
slavikrds [6]
3 years ago
5

circular_prime A number is called a circular prime if all rotations of its digits form a prime. For example, the number 197 is a

circular prime because all possible rotations of its digits: (197, 971, 719) are prime numbers. Write a program that reads in an integer 1 en 10^5 as input and prints True if n is a circular prime and False otherwise.
Computers and Technology
1 answer:
Lilit [14]3 years ago
3 0

Answer:

function out=circular_primes(no)

prim=primes(no);% find the all prime number till the given number

pr=0;

nos=[];

po=[];

for p=1:length(prim)

   n=prim(p); % picking up each prime no one by one

   n=num2str(n);% change into string for rotation of no

   d=length(n); % length of string

   if d>1          % take nos greater than 10 beacuase below 10 no need for rotation

       for h=1:d

           a=n(1);

           for r=1:d % for rotation right to left

               if r==d  5 % for the last element of string

                   n(d)=a;

               else

               n(r)=n(r+1); %shifting

               end

           end

           

       s=str2num(n); % string to number

       nos=[nos,s]; % store rotated elements in array

       end

       if nos(end)==no   %if given no is also a circular prime we need smaller

           break;

       end

       for gr=1:length(nos) % checking rotated nos are prime or not

           p1=isprime(nos(gr));

           po=[po,p1];    %storing logical result in array

       end

           if sum(po(:))==length(nos) %if all are prime the length and sum are must be equal

               

               pr=pr+1;

               out=pr;

           else

               out=pr;

           end

       po=[];

       nos=[];

   else  

       s=str2num(n); %numbers less than 10

       f=isprime(s);

       if f==1

           pr=pr+1;

           out=pr;

       else

           out=pr;

       end

   end

       

      end

end

Explanation:

You might be interested in
How can you troubleshoot Internet access problems?
joja [24]

Answer:

Check the network icon (or wireless connection settings) to see if you have Internet access. ...

Check for changes to proxy settings.

Check the network cables if your computer is wired to the router.

Reset your router.

Check your firewall or security software.

Hopefully this helps.

8 0
3 years ago
A user logs in to a virtual world and creates an animated character representing themselves, which they then use to move through
Romashka [77]

A type of animated character that represents a user in the virtual world, which is used to move throughout the world and interact with other characters and objects is called an <u>avatar</u>.

<h3>What is an avatar?</h3>

An avatar can be defined as a type of animated character that is designed and developed by a software developer to represent a user or player in the virtual world, which is used to move throughout the world and interact with other characters and objects.

In gaming technology and software development, an avatar is typically used to denote a user's (player's) character in the gaming world, virtual world or computer-simulated environment, either in two-dimensional (2D) or three-dimensional (3D).

Read more on avatar here: brainly.com/question/26479902

4 0
2 years ago
Read 2 more answers
A computer user who purchases a software package that will not operate on his or her hardware configuration is a victim of which
Natalija [7]
Is this a math problem? I don't get what you are trying to say sorry
5 0
3 years ago
The freemen's bureau was the U.S.' first ____ program.​
Ludmilka [50]

Answer:

welfare

Explanation:

The Freemen's bureau was the first Welfare program in the US that was put forward in the year 1865 just after the assassination of Abraham Lincoln. It was headed by Oliver O Howard. And it was brought for providing the food, clothing, medical care, and education to the recently freed white refugees and the freed slaves. And it was supposed to be a kind of welfare.  

6 0
3 years ago
Google is an example of a(n):
bixtya [17]
It would B, because anytime you search it always pulls up google search engine.
8 0
3 years ago
Read 2 more answers
Other questions:
  • The ____ function sums the numbers in the specified range and then divides the sum by the number of cells with numeric values in
    14·1 answer
  • Which of these browsers was the first widely adopted?
    12·1 answer
  • Draw a project network from the following information. What activity(ies) is a burst activity? What activity(ies) is a merge act
    7·1 answer
  • What phrase indicates someone has knowledge and understanding of computer,internet,mobile devices and related technologies?
    6·1 answer
  • What is a computer attack where an attacker accesses a wireless computer network, intercepts data, uses network services, and/or
    7·1 answer
  • Rounding up and down for 389,422
    7·1 answer
  • Part of the central processing unit
    14·1 answer
  • True or False: Mapping annotations are exclusive - an annotated method will only be accessible to requests sent to a matching UR
    14·1 answer
  • Fill in the table below of the Interactive Word Wall. You are provided with the
    13·1 answer
  • please help me to do this computer homework I beg you all please help me to get the answers please its important please ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!