Ask Your Question

Revision history [back]

Tips:

  • use itertools.product for iterating over a cartesian product
  • find ways to not iterate over the full cartesian product, using symmetries
    • that might mean iterating over partitions for instance
  • use is_square() rather than computing the square root and checking whether it is in ZZ
  • use is_perfect_power
  • compute squares and cubes modulo some numbers and use such lists for pre-checks

Tips:

  • use itertools.product for iterating over a cartesian product
  • find ways to not iterate over the full cartesian product, using symmetries
    • that might mean iterating over partitions for instance
  • use is_square() rather than computing the square root and checking whether it is in ZZ
  • use is_perfect_power
  • compute squares and cubes modulo some numbers and use such lists for pre-checks
  • use the fact that cubes that are also squares are in fact sixth powers