21

2

Given a positive integer, print that many hamming numbers, in order.

Rules:

- Input will be a positive integer \$n \le 1,000,000 \$
- Output should be the first n terms of https://oeis.org/A051037
- Execution time must be < 1 minute
- This is code-golf; shortest code wins

OEIS – Stephen – 2017-08-18T17:24:35.460

31 is a Hamming number, so, printing 1,000,000

`1`

s is conformant with your specs. It will also be in order, i.e. not an unordered sequence. :) – Will Ness – 2018-01-05T15:03:04.423Sorry for not being specific. I haven't solved this myself, so I'm not sure if the bounds I put in are reasonable. Please let me know. – grokus – 2011-01-30T22:54:31.577

2Which aim an answer should have? Golf? Most effective algorithm? Just searching of solution methods? – Nakilon – 2011-01-28T00:19:56.880