Find the nth Ugly Number

Problem Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, … shows the first 11 ugly numbers. …By convention, 1 is included. Write a program to find and print the 1500’th ugly number.   Solution Method 1 - Brute force Loop for all positive integers until ugly number count is smaller than n, if an integer is ugly than increment ugly number count. [Read More]

Left most n digits divisible by n

A number of 9 digits has the following properties: The number comprising the leftmost two digits is divisible by 2, that comprising the leftmost three digits is divisible by 3, the leftmost four by 4, the leftmost five by 5, and so on for the nine digits of the number i.e. the number formed from the first n digits is divisible by n, 2<=n<=9. Each digit in the number is different i. [Read More]

The smallest no. such that if its rightmost digit is placed at its left end, the new number so formed is precisely 50% larger than the original no.

Ques Find the smallest number such that if its rightmost digit is placed at its left end, the new number so formed is precisely 50% larger than the original number.

Answer The answer is 285714. If its rightmost digit is placed at its left end, then new number is 428571 which is 50% larger than the original number 285714.

l.w= 28….28*2+1 = 57…28/2 = 14

Sum of last digit = sum of rest digits

Consider a number 235, where last digit is the sum of first two digits i.e. 2 + 3 = 5. How many such 3-digit numbers are there? **Ans **There are 45 different 3-digit numbers. Take the combinations The last digit can not be 0. If the last digit is 1, the only possible number is 101. (Note that 011 is not a 3-digit number) If the last digit is 2, the possible numbers are 202 and 112. [Read More]