That sounds tricky!

Level pending

Let N 1 N_1 be a subset of N N .The only difference between N N and N 1 N_1 is that every element of N 1 N_1 is not divisible by either 2 2 or 3 3 .If Lawrence decides to write down the numbers of N 1 N_1 in increasing order what would be the number in the 1999 1999 -th position?


The answer is 5995.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Prasun Biswas
Feb 3, 2014

I used Turbo C++ to solve this and here is my code :

#include<iostream.h>
#include<conio.h>
void main()
    {
    long p,i=1;
    clrscr();
    for (p=1;p>0;p++)
        {
        if(p%2==0||p%3==0)
            continue;
        else
            {
            if(i==1999)
                {
                cout<<"Answer= "<<p;
                break;
                }
            }
        i++;
        }
    getch();
    }

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...