"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 numbers. By convention, 1 is included.
Write a program to find and print the 1501'st number.
There is no input to this program. Output should consist of a single line as shown below,
with <number> replaced by the number computed."
Well, I'm trying to help, but if I say very much more, I will have done the entire thing for you. How about you write the program as best you can, and then come back with questions. I always find with stuff like this, I never really understand it till I start to get pretty deep into the middle of it.
Yes, that's the idea. But its easy enough to test this for yourself. Try some easy numbers like 12 and 15, as well as some failed ones like 14 or 22. Once you're satisfied with testing an individual number, you can move on to trying to put it inside a loop.
> the real issue here is getting something which will run in a reasonably short timescale.
The sequence consist of number in the form n = 2a 3b 5c
So you can simply generate numbers from the sequence, sort them and pick up the 1501th element.
The problem would be the limits for `a', `b' and `c' in order to guarantee that our container holds the exact sequence until the 1501 position, (no holes)