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]
2 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]2 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
Create a SELECT statement that returns the count, average, max and min of the invoices submitted by each vendor, who has submitt
sveta [45]

Answer:

SELECT Count(order_invoice) as number_of_invoices, Max(order_invoice) as maximum_invoice, Min(order_invoice) as minimum_invoice, Avg(order_invoice) as average_invoice

FROM vendor JOIN invoice ON invoice.id = vendor.id

WHERE order_invoice > 1

ORDER BY number_of_invoices DESC

Explanation:

The select statement of the SQL or structured query language returns twelve rows of four columns from the inner join of the vendor and invoice table in a database where the order_invoice column in the invoice table is greater than one. The result of the query is ordered by the alias column "number_of_invoices" in descending order.

8 0
2 years ago
What is the full form of html​
zepelin [54]

Answer:

Hypertext Markup Language

Explanation:

Hypertext Markup Language

5 0
2 years ago
Read 2 more answers
A ___________ allows Internet telephony service providers to deliver telephony services and unified communications applications
Firlakuza [10]

Answer: SIP Trunk

Explanation:

   The SIP is stand for the session initiation protocol trunk is one of the service that is specifically provided by the service provider and the main purpose of the SIP trucking is to manage the VoIP call process (Voice over IP).

According to the given question, SIP is one of the protocol that allow telephony services for the communication purpose and it also offer the video, Message, media and the voice application and these process are control by using this type of technology.  

 Therefore, SIP Truck is the correct answer.  

8 0
3 years ago
How is ict integrated into marketing<br>​
Aleks04 [339]

Answer: The utilize of great ICT moreover moves forward client administrations and client request. From database advancement, site plan to showcase investigate, interpretation program, coordinate mail showcasing and preparing, the application of ICT is basic for a financial victory. The web is one of the ways in which media companies / businesses publicize.

Explanation:

5 0
1 year ago
The factorial of n is equal to ______.
alexdok [17]

Answer:

n! = n*(n-1)*(n-2)*(n-3)* ... *2*1

Explanation:

The factorial operator is simply a mathematical expression of the product of a stated integer and all integers below that number down to 1.  Consider these following examples:

4! = 4 * 3 * 2 * 1

4! = 12 * 2 * 1

4! = 24

6! = 6 * 5 * 4 * 3 * 2 * 1

6! = 30 * 4 * 3 * 2 * 1

6! = 120 * 3 * 2 * 1

6! = 360 * 2 * 1

6! = 720

So, the factorial of n would follow the same as such:

n! = n * (n-1) * (n-2) * ... * 2 * 1

Cheers.

5 0
2 years ago
Other questions:
  • A custom date format set for a date/time field that contains the symbols mmm/dd/yy would display the date as ____.
    12·1 answer
  • How to cite a website, like asha.org?
    6·1 answer
  • What should be used to keep a tablet dry?
    13·1 answer
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • Before inserting a preformatted table of contents, what must you do first?
    8·1 answer
  • Which of the following is a career that's indirectly linked to careers in web technologies?
    10·1 answer
  • D. DROP
    6·1 answer
  • you are working on creating a business document with two other co-workers. Based on just information, which of the following pre
    14·1 answer
  • Commercial technical data and commercial software:_________.
    11·1 answer
  • It's important to understand that even information systems that do not use computers
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!