FiSGO.OrderSearch.prod_scanned

prod_scanned(factored1, factored2)[source]

Given two tuples originating from PrimesHandler.prime_scanner with the same upper_bound (or same length), returns the product of both decompositions.

Idea: if factored1 corresponds to a number n1 and factored2 to n2, then prod_scanned returns Primes.prime_scanner(n1*n2, upper_bound) without having to construct n1*n2 explicitely.

Example:

>>> prod_scanned(([1,1],1), ([3,0], 7))
([4, 1], 7)
Parameters:
  • factored1 (tuple[list[int], int]) – Tuple with a list of integers and an integer.

  • factored2 (tuple[list[int], int]) – Tuple with a list of integers and an integer.

Return type:

tuple[list[int], int]

Returns:

Partially factorized product of the numbers represented by factored1 and factored2.