Puzzle: Kth number with only prime factors 3,5,7.

5030 views
Design an algorithm to find the kth number  such that the only prime factors are 3,5, and 7.

1 Vote Up   |   Post Answer

By  Vineet JhunJhunwala





Sangeeta Haldhar Sangeeta Haldhar   11 years ago

3=2*1+1,
5=2*2+1,
7=2*3+1
So,Kth element is:-
2K+1

Reply    3 Vote Up   5 Vote Up
Abhishek Gupta Abhishek Gupta   10 years ago

11=2*5+1

Reply    0 Vote Up   0 Vote Up