Knowee
Questions
Features
Study Tools

Numbers from 1 to 100 are taken. All the multiples of 2 are coded as m. Then, all the multiples of 3 are coded as n. Then, all the multiples of 4 are coded as p. Then, all the multiples of 5 are coded as q. For example, 35 will be coded as q, 27 will be coded as n and 62 will be coded as m. If a number is coded more than once, then the coding done on it in the end will apply. For example, 24 will be first coded as m (multiple of 2), then as n (multiple of 3) and then as p (multiple of 4). So, it will be coded as p as this coding was done at the end.How many numbers will be coded as n?

Question

Numbers from 1 to 100 are taken. All the multiples of 2 are coded as m. Then, all the multiples of 3 are coded as n. Then, all the multiples of 4 are coded as p. Then, all the multiples of 5 are coded as q. For example, 35 will be coded as q, 27 will be coded as n and 62 will be coded as m. If a number is coded more than once, then the coding done on it in the end will apply. For example, 24 will be first coded as m (multiple of 2), then as n (multiple of 3) and then as p (multiple of 4). So, it will be coded as p as this coding was done at the end.How many numbers will be coded as n?

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

To solve this problem, we need to find out how many numbers between 1 and 100 are multiples of 3, but not multiples of 4 or 5 (since the coding done at the end will apply).

Step 1: Find out how many numbers between 1 and 100 are multiples of 3. This can be done by dividing 100 by 3. The integer part of the result is the number of multiples of 3. So, there are 33 multiples of 3.

Step 2: Find out how many numbers between 1 and 100 are multiples of 4. This can be done by dividing 100 by 4. The integer part of the result is the number of multiples of 4. So, there are 25 multiples of 4.

Step 3: Find out how many numbers between 1 and 100 are multiples of 5. This can be done by dividing 100 by 5. The integer part of the result is the number of multiples of 5. So, there are 20 multiples of 5.

Step 4: Subtract the number of multiples of 4 and 5 from the number of multiples of 3. This is because these numbers will not be coded as 'n' as they will be coded as 'p' or 'q' at the end. So, the number of numbers that will be coded as 'n' is 33 - 25 - 20 = -12.

However, we have double subtracted the numbers which are multiples of both 4 and 5. These numbers are multiples of 20. So, we find out how many numbers between 1 and 100 are multiples of 20 by dividing 100 by 20. The integer part of the result is the number of multiples of 20. So, there are 5 multiples of 20.

Step 5: Add the number of multiples of 20 to the result from step 4 to get the final answer. So, the number of numbers that will be coded as 'n' is -12 + 5 = -7.

This is not possible as the number of numbers cannot be negative. So, there seems to be a mistake in the problem or in the calculation.

This problem has been solved

Similar Questions

Digits in the number given in front of the following questions are to be coded based on the digit and the conditions given below:Digit 2 9 4 6 3 8 1 7 5 0Code P M R K T V B W F DConditions:(1) If both the first and the last digits of a number are odd numbers, they should be coded as 'Z'.(2) If both the first and the last digits of a number are even numbers, they should be coded as 'A'.Now based on the above information find out which of the combinations is the coded form of the given number in each question.372528:ZWPFVZZWPFVBTWPFVZAWPFVA

A company puts a code on each different product they sell. The code is made up of 3 numbers and 2 letters. How many different codes are possible?(no alphabet and numbers will be repeated )Choices:- 52000 625000 60000 468000

Below table represents the codes for the different numerals:Conditions:If the middle number is even then it is coded as **.If the middle number is prime then it is coded as ^^.If the last number is even then it is coded as +.The code corresponding to the number 49738147 is*&/@%***$&@&!@%**$*&@&/@%***#&@&/@%**#*&@

What will be the output of the following pseudocode?Integer pp, qq, rrset pp=5, qq= 1, rr= 4if ( pp > rr)if (qq > rr )rr = 1qq = rr + 1pp = rr + 2end if qq = pp+ 1elsepp = pp + 1end if printf pp + qq + rr

What will be the output of the following pseudo code?1. Integer p, q, r2. Set p=4, q=2, r=63. if((q-p-r) < (r - q))4. r=(q+p) & q5. End if6. r =3+q7. r =3+q8. r =3+q9. print p+q+r

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.