Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Primes() is not a list, but essentially a generator of primes with some additional functions. While it can generate primes one by one, it does not store them all at once anywhere (and so it's not a list). We can create a generator for integers of the form $p^k - 1$ in their natural order like

PP = (q-1 for q in NN if is_prime_power(q))

As for finite products of elements of PP, again we cannot store them in the list unless they are somehow bounded. So, you need to be a bit more specific how you want to generate those products.