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
Please Help ASAP! 30 Points! Will Mark Brainliest! Please Don't Waste Answers! It's Due In 40 Minutes Please Help Me!
weeeeeb [17]

Answer: 2.)  Scratch is a website where you can create your on games from scratch. I chose this because it is very fun to play :D

I hope you pass your test.

Have a great day.

6 0
3 years ago
What are the advantages of cloud computing over computing on premises?
Verdich [7]

Answer:

answer my question

Explanation:

<h3>open my account. i need help.</h3>
3 0
2 years ago
An online service allows users to integrate their phonebook with their social media profiles and stores it on the cloud. The pho
Tasya [4]
A) Software as a Service (SaaS)

SaaS refers to full applications deployed in the cloud, whereas PaaS and IaaS refer to cloud services that allow for development of new applications with varying levels of hardware abstraction. IaaS usually refers to cloud Virtual Machines, and it allows more control over the types of computers used to run an application (Linux/Windows/RAM/CPUs/etc). PaaS is a set of minimum required components to make an application run, typically not visible to developers. Developers can write code and deploy to a PaaS service without configuring virtual machines or installing dependencies/Operating Systems.
6 0
3 years ago
Which of the following correctly describes the reason for quality customer service?
Vera_Pavlovna [14]
The correct answer is C. Keep existing customers and clients
Explanation:
Customer service refers to the interaction with customers and support employees in a company provide to customer to guarantee he or she has the best experience when buying one product or service. A high-quality customer service implies providing complete information to customers, and helping them before, during, and even after their process in buying or looking for information in a company. The main purpose of this is that customers feel the support from employees, and are loyal to the company which means they will go back if they need the same service or products. Thus, the reason for quality customer service is "Keep existing customers and clients".
7 0
3 years ago
Madison works for Google as an Ethical Hacker. Madison main job responsibility is
Ivenika [448]

Answer:

to evaluate the security and identify vulnerabilities of a business

Explanation:

Madison is an ethical hacker (white hat hacker), meaning she is hired by companies to make sure that "evil" hackers (black hat hackers) can't hack into their websites.

7 0
3 years ago
Read 2 more answers
Other questions:
  • True or false? malware problems and other compromises of your computer information are rare.
    15·1 answer
  • Charlie is a British national who works in the United States as a novelist for children. Because he is British, he types the wor
    10·2 answers
  • 97 points pleaseeee helpppp
    8·2 answers
  • A domain name is used to: *
    15·1 answer
  • III. FILL-IN THE BLANK (five points each)
    14·1 answer
  • ____ is an easy way to invitation through a web page​
    13·1 answer
  • What is the difference between a debit card and<br> a smart card?
    15·1 answer
  • Is it possible to construct a wait-free n-thread PeekableStack(2) object from an arbitrary number of atomic Stack objects and at
    11·1 answer
  • . 。 • ゚ 。 .
    10·2 answers
  • Legends are titles given to three-axis X, Y, and Z-axis. True or false?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!