Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
7 votes
2 answers
2k views

Generate all combinations of certain digits

Related to another answer of mine on Project Euler 35, I found the need to calculate all combinations of certain digits, i.e. 1, 3, 7 and 9, below a given n. I ...
holroy's user avatar
  • 11.7k
5 votes
2 answers
11k views

Python generator function that yields combinations of elements in a sequence sorted by subset order

In Python, itertools.combinations yields combinations of elements in a sequence sorted by lexicographical order. In the course of solving certain math problems, I ...
Adeel Zafar Soomro's user avatar